{"id":626,"date":"2007-06-21T00:41:45","date_gmt":"2007-06-20T22:41:45","guid":{"rendered":"http:\/\/planetozh.com\/blog\/2007\/06\/text-editors-for-coders-deathmatch-review\/"},"modified":"2007-11-29T22:00:23","modified_gmt":"2007-11-29T20:00:23","slug":"text-editors-for-coders-deathmatch-review","status":"publish","type":"post","link":"https:\/\/planetozh.com\/blog\/2007\/06\/text-editors-for-coders-deathmatch-review\/","title":{"rendered":"Text Editors for Coders : Deathmatch Review"},"content":{"rendered":"<p>I have been using UltraEdit as my primary text editor over the last few years. I thought it had all the features I could expect from a text editor : tabbed interface, syntax highlighting for a number of languages, code block collapsing, regular expressions for searching and replacing, opening and closing brace matching, you name it.<\/p>\n<p>Then, recently, I got more and more annoyed by the weaknesses of the code highlighting feature. For instance, UltraEdit gets it wrong if you use heredoc syntax (using something like <tt><<<<i><\/i>HERE<\/tt> and <tt>HERE;<\/tt> as delimiters for a string) and can&#39;t parse and highlight properly your code.<\/p>\n<p>One night, someone in #wordpress mentioned they were using PSPad. I realized that, after all, I had been using the same text editor over the years simply because I had never looked if something better existed. So I loaded my gun and went for a little hunt, hoping to find the perfect text editor. UltraEdit, Notepad++, PSPad, EditPlus, EditPad Pro, Crimson Editor, GridinSoft Notepad, HTML-Kit, I tortured them all with my binary and merciless 10 seconds review tool: the <strong>Tricky Code Snippet From Hell<\/strong>.<br \/>\n<!--more--><\/p>\n<h2>The test<\/h2>\n<p>I made up a short and catchy text file filled with traps I knew most editors would fall in, which consisted of the following :<\/p>\n<div id=\"ig-sh-1\" class=\"syntax_hilite\">\n\n\t\t<div class=\"toolbar\">\n\n\t\t<div class=\"view-different-container\">\n\t\t\t\t\t\t<a href=\"#\" class=\"view-different\">&lt; View <span>plain text<\/span> &gt;<\/a>\n\t\t\t\t\t<\/div>\n\n\t\t<div class=\"language-name\">php<\/div>\n\n\t\t\n\t\t<br clear=\"both\">\n\n\t<\/div>\n\t\n\t<div class=\"code\">\n\t\t<ol class=\"php\" style=\"font-family:monospace\"><li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #000000;font-weight: bold\">&lt;?php<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp;<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #000088\">$pattern<\/span> <span style=\"color: #339933\">=<\/span> <span style=\"color: #0000ff\">'(&lt;body&amp;#91;^&gt;]*?&gt;'<\/span><span style=\"color: #339933\">;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp;<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #666666;font-style: italic\">\/*&nbsp; abcdef<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #666666;font-style: italic\">&nbsp; &nbsp; multi-line<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #666666;font-style: italic\">*\/<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp;<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #000088\">$hello<\/span> <span style=\"color: #339933\">=<\/span> <span style=\"color: #0000cc;font-style: italic\">&lt;&lt;&lt;HELLO<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #0000cc;font-style: italic\">&nbsp; &nbsp; &lt;&lt;&lt;&lt;--! jk --&gt;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #0000cc;font-style: italic\">&nbsp; &nbsp; &gt;&gt;&gt;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #0000cc;font-style: italic\">&nbsp; &nbsp; \/*<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #0000cc;font-style: italic\">&nbsp; &nbsp; abcdef<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #0000cc;font-style: italic\">HELLO<\/span><span style=\"color: #339933\">;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp;<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #000000;font-weight: bold\">function<\/span> echoit<span style=\"color: #009900\">&#040;<\/span><span style=\"color: #000088\">$pattern<\/span><span style=\"color: #009900\">&#041;<\/span> <span style=\"color: #009900\">&#123;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp; &nbsp; <span style=\"color: #b1b100\">echo<\/span> <span style=\"color: #0000ff\">&quot;123 456 <span style=\"color: #006699;font-weight: bold\">$pattern<\/span>&quot;<\/span><span style=\"color: #339933\">;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp; &nbsp; <span style=\"color: #b1b100\">echo<\/span> <span style=\"color: #0000ff\">'123 456 $pattern'<\/span><span style=\"color: #339933\">;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp; &nbsp; <span style=\"color: #b1b100\">foreach<\/span> <span style=\"color: #009900\">&#040;<\/span><span style=\"color: #990000\">array<\/span><span style=\"color: #009900\">&#040;<\/span><span style=\"color: #cc66cc\">1<\/span><span style=\"color: #339933\">,<\/span><span style=\"color: #cc66cc\">2<\/span><span style=\"color: #339933\">,<\/span><span style=\"color: #cc66cc\">3<\/span><span style=\"color: #009900\">&#041;<\/span> <span style=\"color: #b1b100\">as<\/span> <span style=\"color: #000088\">$val<\/span><span style=\"color: #009900\">&#041;<\/span> <span style=\"color: #009900\">&#123;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp; &nbsp; &nbsp; &nbsp; <span style=\"color: #b1b100\">echo<\/span> <span style=\"color: #000088\">$val<\/span><span style=\"color: #339933\">;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp; &nbsp; <span style=\"color: #009900\">&#125;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #009900\">&#125;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp;<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #b1b100\">echo<\/span> <span style=\"color: #0000ff\">&quot;\/*&quot;<\/span><span style=\"color: #339933\">;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #b1b100\">echo<\/span> <span style=\"color: #0000ff\">'\/\/'<\/span><span style=\"color: #339933\">;<\/span>echoit<span style=\"color: #009900\">&#040;<\/span><span style=\"color: #000088\">$pattern<\/span><span style=\"color: #009900\">&#041;<\/span><span style=\"color: #339933\">;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp;<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #000000;font-weight: bold\">?&gt;<\/span><\/div><\/li>\n<\/ol>\t<\/div>\n\n<\/div>\n\n<p>From this incongruous yet efficient snippet, I was expecting to check, at a glance and in less than 10 seconds, the following 9 tests:<\/p>\n<ol>\n<li>Line 3: will the editor think the regular expression pattern is actually the closing <tt>?><\/tt> PHP tag<\/li>\n<li>Line 5 to 7: can you collapse multiline comments<\/li>\n<li>Line 9: heredoc, part one, does the editor understands we&#39;re just defining a string<\/li>\n<li>Line 12: heredoc, part tow, does the editor gets that we&#39;re not starting a multi line comment<\/li>\n<li>Line 16: can you collapse regular code block<\/li>\n<li>Line 17 &#038; 18: will the editor display differently these two lines(variable in the first one, just text in the second one)<\/li>\n<li>Line 19: how will the editor display nicely (or not) the nested code folding marks<\/li>\n<li>Line 24: will the editor think we&#39;re starting a multi line comment<\/li>\n<li>Line 25: will the editor think we&#39;re commenting out the line<\/li>\n<\/ol>\n<p>You&#39;ve already noted that the in-blog code highlighter I&#39;m using failed on line 12 and test #4 :) How did the desktop software did?<\/p>\n<p>Results and verdicts.<\/p>\n<h2>Crimson Editor<\/h2>\n<p>I didn&#39;t know this software, but it was in Google&#39;s top results for &quot;text editor&quot; and looked decent, so I gave it a try.<\/p>\n<p><img src='http:\/\/planetozh.com\/blog\/wp-content\/uploads\/2007\/06\/crimson.gif' alt='Crimson Editor' \/><\/p>\n<p>Miserably fails at line 12 (while still being able to highlight matching braces within what it thinks is a comment), and you can&#39;t fold code blocks.<\/p>\n<p><strong>Verdict: Sucked<\/strong>.<\/p>\n<h2>EditPad Pro<\/h2>\n<p>Again a software with a good ranking within Google&#39;s search results. It produced:<\/p>\n<p><img src='http:\/\/planetozh.com\/blog\/wp-content\/uploads\/2007\/06\/editpadpro.gif' alt='EditPad Pro' \/><\/p>\n<p>Incoherent results: fails at line 3, while still giving folding marks for the whole file (does it end on line 3 or not??), you can collapse a function block but not the nested foreach block. That&#39;s too bad, because the highlighting abilities were not mislead by the heredoc and its deadly line 12, and it does make a difference between line 17 and 18. Almost passed.<\/p>\n<p><strong>Verdict: Sucked<\/strong>.<\/p>\n<h2>EditPlus<\/h2>\n<p>I was recommended this software by some friends.<\/p>\n<p><img src='http:\/\/planetozh.com\/blog\/wp-content\/uploads\/2007\/06\/editplus.gif' alt='EditPlus' \/><\/p>\n<p>Oh, my. I hope we&#39;re still friends. Died at line 12.<\/p>\n<p><strong>Verdict: Sucked<\/strong>.<\/p>\n<h2>GridinSoft Notepad<\/h2>\n<p>Another software I didn&#39;t know and that was waiting for abuse within Google&#39;s top results.<\/p>\n<p><img src='http:\/\/planetozh.com\/blog\/wp-content\/uploads\/2007\/06\/gridinsoft.gif' alt='GridinSoft Notepad' \/><\/p>\n<p>Pathetically fails at line 3. By the way, I don&#39;t understand why it highlighted HELLO that way.<\/p>\n<p><strong>Verdict: Sucked<\/strong>.<\/p>\n<h2>HTML Kit<\/h2>\n<p>It was recommended by a friend, so I gave it a try despite its name making me thinking it was more HTML oriented than anything else.<br \/>\n<img src='http:\/\/planetozh.com\/blog\/wp-content\/uploads\/2007\/06\/html-kit.jpg' alt='HTML Kit' \/><\/p>\n<p>The highlighting abilities are decent, it doesn&#39;t get fooled by line 3 and the confusing heredoc. Making no difference between line 17 and 18 is too bad, and not being able to collapse block is a no-go with me.<\/p>\n<p><strong>Verdict: Sucked<\/strong>.<\/p>\n<h2>PSPad<\/h2>\n<p>I read about it on #wordpress as a coding tool of choice, so I had a good <em>a priori<\/em> here.<\/p>\n<p><img src='http:\/\/planetozh.com\/blog\/wp-content\/uploads\/2007\/06\/pspad.gif' alt='PSPad' \/><\/p>\n<p>Failed at line 3.<\/p>\n<p><strong>Verdict: Sucked<\/strong>.<\/p>\n<h2>UltraEdit<\/h2>\n<p>The software I thought was the Rolls Royce of editors for years.<\/p>\n<p><img src='http:\/\/planetozh.com\/blog\/wp-content\/uploads\/2007\/06\/ultraedit.gif' alt='UltraEdit' \/><\/p>\n<p>As I knew it, UE understands nothing about heredocs, which is really too bad considering that without this line 12, it would pass every other tests.<\/p>\n<p><strong>Verdict: Sucked<\/strong>.<\/p>\n<h2>Hey&#8230; No winner ?<\/h2>\n<p>Ho, you noticed, all the softwares mentioned got the &quot;Sucked&quot; grade (some well more deserved than others, I&#39;ll fairly admit it). No winner, then ? Of course there&#39;s a winner, would I bother writing such a useless review otherwise ? :)<\/p>\n<h2>Notepad++<\/h2>\n<p>I started using <a href=\"http:\/\/notepad-plus.sourceforge.net\/\">Notepad++<\/a> two years ago on my computer at work because for some reason I couldn&#39;t properly install UltraEdit (I guess my user limited privileges on Windows 2000 were to be blamed), and had sticked with a very old version of it, till I even had the idea of upgrading to the latest version for this test. Boy, that was a good idea.<\/p>\n<p><img src='http:\/\/planetozh.com\/blog\/wp-content\/uploads\/2007\/06\/notepad.gif' alt='Notepad++' \/><\/p>\n<p>Syntax highlighting is just&#8230; perfect. The heredoc does not fool the software, line 17 and 18 are perfectly shown. The only thing I&#39;d miss is the ability to fold comment blocks (line 5 to 7) but it&#39;s pretty minor to be honest.<br \/>\n<b>Edit<\/b>: Klaue, a reader in comments, points out that you can actually <a href=\"http:\/\/img522.imageshack.us\/img522\/926\/notepadplusplusoj5.jpg\">fold comments<\/a>. It just doesn&#39;t work with PHP, apparently. Sounds like a bug then!<\/p>\n<p><a href=\"http:\/\/notepad-plus.sourceforge.net\/\">Notepad++<\/a> passing the 10 second test, I looked at the rest of features and abilities a simple glance and screenshot cannot reveal. To my pleasure, everything I need is here: search and replace with regexp, bookmarks within your text files, 3rd party plugins, loading and saving &quot;sessions&quot; to work on a predefined group of files. The software came with a very very handy plugin that shows real time a list of functions defined in your text file, which makes it really easy to navigate through your code with a single click on the function name.<\/p>\n<p>In short, I love this software. Did I mention this is freeware ? Give it a try, you&#39;ll love it or I&#39;ll refund !<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have been using UltraEdit as my primary text editor over the last few years. I thought it had all the features I could expect from a text editor : tabbed interface, syntax highlighting for a number of languages, code block collapsing, regular expressions for searching and replacing, opening and closing brace matching, you name [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[219,218,63,13,217,4],"class_list":["post-626","post","type-post","status-publish","format-standard","hentry","category-published","tag-editor","tag-notepad","tag-review","tag-software","tag-ultraedit","tag-windows"],"_links":{"self":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/posts\/626","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/comments?post=626"}],"version-history":[{"count":0,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/posts\/626\/revisions"}],"wp:attachment":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/media?parent=626"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/categories?post=626"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/tags?post=626"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}