In: , , , , ,
On: 2007 / 06 / 21 Viewed: 74573 times

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.

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 <<<HERE and HERE; as delimiters for a string) and can't parse and highlight properly your code.

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 Tricky Code Snippet From Hell.

The test

I made up a short and catchy text file filled with traps I knew most editors would fall in, which consisted of the following :

PHP:
  1. <?php
  2.  
  3. $pattern = '(<body[^>]*?>';
  4.  
  5. /*  abcdef
  6.     multi-line
  7. */
  8.  
  9. $hello = <<<HELLO
  10.     <<<<--! jk -->
  11.     >>>
  12.     /*
  13.     abcdef
  14. HELLO;
  15. function echoit($pattern) {
  16.     echo "123 456 $pattern";
  17.     echo '123 456 $pattern';
  18.     foreach (array(1,2,3) as $val) {
  19.         echo $val;
  20.     }
  21. }
  22. echo "/*";
  23. echo '//';echoit($pattern);
  24. ?>

From this incongruous yet efficient snippet, I was expecting to check, at a glance and in less than 10 seconds, the following 9 tests:

  1. Line 3: will the editor think the regular expression pattern is actually the closing ?> PHP tag
  2. Line 5 to 7: can you collapse multiline comments
  3. Line 9: heredoc, part one, does the editor understands we're just defining a string
  4. Line 12: heredoc, part tow, does the editor gets that we're not starting a multi line comment
  5. Line 16: can you collapse regular code block
  6. Line 17 & 18: will the editor display differently these two lines(variable in the first one, just text in the second one)
  7. Line 19: how will the editor display nicely (or not) the nested code folding marks
  8. Line 24: will the editor think we're starting a multi line comment
  9. Line 25: will the editor think we're commenting out the line

You've already noted that the in-blog code highlighter I'm using failed on line 12 and test #4 :) How did the desktop software did?

Results and verdicts.

Crimson Editor

I didn't know this software, but it was in Google's top results for "text editor" and looked decent, so I gave it a try.

Crimson Editor

Miserably fails at line 12 (while still being able to highlight matching braces within what it thinks is a comment), and you can't fold code blocks.

Verdict: Sucked.

EditPad Pro

Again a software with a good ranking within Google's search results. It produced:

EditPad Pro

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'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.

Verdict: Sucked.

EditPlus

I was recommended this software by some friends.

EditPlus

Oh, my. I hope we're still friends. Died at line 12.

Verdict: Sucked.

GridinSoft Notepad

Another software I didn't know and that was waiting for abuse within Google's top results.

GridinSoft Notepad

Pathetically fails at line 3. By the way, I don't understand why it highlighted HELLO that way.

Verdict: Sucked.

HTML Kit

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.
HTML Kit

The highlighting abilities are decent, it doesn'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.

Verdict: Sucked.

PSPad

I read about it on #wordpress as a coding tool of choice, so I had a good a priori here.

PSPad

Failed at line 3.

Verdict: Sucked.

UltraEdit

The software I thought was the Rolls Royce of editors for years.

UltraEdit

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.

Verdict: Sucked.

Hey... No winner ?

Ho, you noticed, all the softwares mentioned got the "Sucked" grade (some well more deserved than others, I'll fairly admit it). No winner, then ? Of course there's a winner, would I bother writing such a useless review otherwise ? :)

Notepad++

I started using Notepad++ two years ago on my computer at work because for some reason I couldn'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.

Notepad++

Syntax highlighting is just... perfect. The heredoc does not fool the software, line 17 and 18 are perfectly shown. The only thing I'd miss is the ability to fold comment blocks (line 5 to 7) but it's pretty minor to be honest.
Edit: Klaue, a reader in comments, points out that you can actually fold comments. It just doesn't work with PHP, apparently. Sounds like a bug then!

Notepad++ 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 "sessions" 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.

In short, I love this software. Did I mention this is freeware ? Give it a try, you'll love it or I'll refund !

Related posts

Metastuff

This entry "Text Editors for Coders : Deathmatch Review" was posted on 21/06/2007 at 12:41 am and is tagged with , , , , ,
Watch this discussion : Comments RSS 2.0. You can trackback this post from your own site

36 Blablas

    Pages: « 1 [2] Show All

  1. 21
    Sean O United States »
    wrote, on 11/Oct/07 at 3:53 pm # :

    I used Notepad++ for months, thinking it was the bee's knees. But then I found PSPad a few weeks ago, and it's earned the title as go-to editor. Tabbed Interface, multi-code-highlighting, projects, text diffs, many user-created extensions, etc. etc.

    But what sealed it for me was built-in site management over http://FTP. Work with remote files as if they're local. Couple that with ability to run from your USB drive, and you've got a powerful, anywhere, any-code editor.

    My only task now is to find (or write) the handy "duplicate line" function from Notepad++...

  2. 22
    Ozh France »
    wrote, on 11/Oct/07 at 7:24 pm # :

    Sean O » I find PSPad's highlighting abilities quite average. Nice software other than that. But so behind N++ :)

  3. 23
    tom Australia »
    replied, on 17/Nov/07 at 4:23 am # :

    How is his a comparison of text editors when you don't evaluate them on their ability to actually edit text?

  4. 24
    Ozh France »
    thought, on 17/Nov/07 at 11:02 am # :

    tom » Wow. This is probably one of the silliest comment across my whole blog.

  5. 25
    Klaue Switzerland »
    thought, on 29/Nov/07 at 3:52 pm # :

    Actually, you can fold comments in Notepad++. It just doesn't work for PHP (try to select C++ in languages and you can)
    Maybe you should write this in case someone uses the article to choose a texteditor for a non-php language

  6. 26
    Ozh France »
    said, on 29/Nov/07 at 9:45 pm # :

    Klaue » ho, nice, I didn't know this. Thanks!

  7. 27
    Rob United States »
    said, on 29/Nov/07 at 11:06 pm # :

    I've been using NP++ for about a year now. It's truly great, isn't it?

    A couple features I use a lot are:

    find/replace in all opened documents
    regex find/replace

  8. 28
    DavidTan Australia »
    thought, on 27/Dec/07 at 7:20 am # :

    Nice read. I love PSPad and Notepad++, they are probably the only 2 text-editor (not IDE!) that you will ever need.

  9. 29
    Wgaffa Sweden »
    said, on 30/Dec/07 at 1:52 am # :

    I tested the code in E-Texteditor and it seemed to pass all your requirements. It could even fold multiline comments but it gets fooled at line 12 and 24 as it doesnt know where it ends and therefore collapses to the end of the file.

  10. 30
    Leeoniya United States »
    wrote, on 19/Jan/08 at 8:16 am # :

    Ozh, i came to the same conclusions that you did. but i have to have live tag matching.

    try dev-PHP or anything else that uses the SynWeb component: http://flatdev.ovh.org/downloads.php?project=2

    they all pass your php syntax test, are as good if not better than all scintilla-based editors like notepad++, notepad2, programmer's notepad2, sciTE etc. plus you get live HTML tag matching.

    depending on the implementation tho, you may or may not get tag and attribute code hints (for css and html), tag auto completion, and color picker and file path browse dialogs which are the only other things i would like to see to greatly improve usability. php designer is not free, but has a ton more stuff that makes it the best php editor i think w/live syntax checking, xdebug, ftp, SVN etc.

    Leon

  11. 31
    David United States »
    wrote, on 03/Feb/08 at 6:49 am # :

    The version of EditPad Pro that I'm using (6.3.2) does not presume that line 3 is a closing tag, and the editor will autofold comments and For loops if you set one of its configuration options to generate folds based on text indentation (not perfect, I realize, but better than nothing).

  12. 32
    Carbonize Great Britain (UK) »
    commented, on 11/Mar/08 at 8:03 pm # :

    Whilst Notepad++ has great syntax support this is due to the component used and the the person who makes the program. But as someone else has commented it takes more than good syntax highlighting to make a good text editor. I have used both PSPad and Notepad++ and always return to PSPad. My main reasons for this is that PSPad has a better list of PHP functions and can complete them as either just the function and parenthesis or as the complete function and attribute descriptions as taken from php.net. And I just tested your test code on PSPad and switched it to PHP highlighting and not HTML multihighlighter and it passes line 3 fine but fails on the heredoc. Also I find PSPad easier to use and it's configuration makes more sense.

    Just to add that Notepad++ does now have FTP support.

  13. 33
    Mat Slovenia »
    commented, on 06/May/08 at 10:59 am # :

    I just wonder, which of the editors supports regex syntax that oneself can make?

  14. 34
    adrian Indonesia »
    said, on 27/May/08 at 8:15 pm # :

    Notepad++ code snippet's hotkey (quicktext plugin) is Ctrl Enter -- which is a great downside for me. i think people has cried out for the Tab hotkey for ages now :)

  15. 35
    adrian liem Indonesia »
    said, on 28/May/08 at 9:56 pm # :

    and i tried to fix that -- i hope
    https://sourceforge.net/forum/message.php?msg_id=4991463

  16. 36
    Firebat Mexico »
    commented, on 04/Jul/08 at 11:59 pm # :

    Great list, personally I have been using phpDesigner in windows and I find it quite nice especially since it highlights syntax errors such as a missing ";".

    Might as well test it with your tricky code when I get home. Using linux however, I really love Gedit (Gnome's default editor) just tested your code there and it has no syntax highlight flaws, its only missing the collapse option. What I really like about it though is the ability to use it with gnome's ftp connections and open/save as if remote files were local.

    Regards

Pages: « 1 [2] Show All

Leave a Reply

Comment Guidelines or Die

  • HTML: You can use these tags: <a href=""> <em> <i> <b> <strong> <blockquote>
  • Posting code: Post raw code (no <> &lt; etc) within appropriate tags : [php][/php], [css][/css], [html][/html], [js][/js], [sql][/sql], [xml][/xml], or generic [code][code]
  • Gravatars: Curious about the little images next to each commenter's name ? Go to Gravatar.
  • Spam: Various spam plugins on patrol. I'll put pins in a Voodoo doll if you spam me.
  • I will mark as Spam test comments, all comments with SEO names (ie "My Cool Online Shop" instead of "Joe") or containing forum-like signatures.

Read more ?

Close
E-mail It