Monday, July 29, 2013

In search of a good code editor

Every coder worth his/her salt is always looking for a better code editor. Why? Because, there is always something in a code editor you are currently using (or, are forced to use) that ... you don't like, or doesn't work, or is plain broken. But, why stick with it then? Well, might be for variety of reasons: 
  • Your organization mandates using it, and everyone in the team uses it
  • It is still the editor with least amount of nuisance
  • The editor has something special about certain software project you are working on
Happens with everyone. Happens with me. Here are my set of editors:
  • Visual Studio
    • C#, .NET
    • Javascript, HTML5 (mobile coding)
  • Eclipse
    • Java
    • Perl (with the EPIC plugin)
  • PSPad
    • SQL
    • Text files
    • Everything else.
The features I value in a code editor, in no specific preference, are color coding/syntax highlighting, auto-completion of symbol names, method names and properties, code folding (in regions), line wrapping and split windows. I think Visual Studio does all this things perfectly, and would have been pathway to coding nirvana, had it not for the two problems:
  • The latest and greatest of it costs money (I know, there is an express version, and I think that is really really good)
  • It is not general purpose for all languages that I use. 
The last one is big, so even if I have VS open almost all the time, I sill have to open bunch of other editors as well to get stuff done. Eclipse, on the other hand, doesn't give me that feel. It is very powerful and free, but always feels a little sluggish, weird, and what not. Eclipse also does not have auto-completion of symbol names (without doing CTRL+SPACE), which I find very helpful. But I stick with it, because it has special tooling for android development.

PSPad, on the lower end, has been reasonably good to me. It doesn't have any auto-completion or code folding, but the files I work with in PSPad, I mostly don't need those features. I needed those features for perl, which is why moved perl from PSPad to Eclipse. 

Courting with Geany
A few months back, I uninstalled PSPad after using it for more than five or so years, because I discovered another editor called Geany. I read about it, installed it and it looked good. Not only was it small and fast, but it seemed to have all the features I need. I was even thinking I would be able to bring back perl, and even java [*shiver*] (with android). If I can replace Eclipse and PSPad with Geany - that would itself be pretty cool.

Unfortunately, the dating period wasn't too long. Here are a few reasons:
  • The editor is based on GTK+. That means, in order to install it, you will have to install GTK+ first. I don't like to install too many things, and this didn't go well. Note: this wasn't a deal-breaker in itself, but accompanied with other ones, it was.
  • The autocomplete feature of Perl or java wasn't a true autocomplete - if you press CTRL+SPACE after typing one or ore letters, the editor would show any token in the file starting with those characters. It works as autocomplete, and is better than nothing, but isn't the same as I understand from VS.
  • Finally, interface was a bit old style ... for my taste anyways.
Next in Line: Notepad++
So, when I got my new laptop, I decided to look for another editor yet again. This time it was the turn for Notepad++. The feature set looked good (yes, it also supports autocomplete without having to press any extra keys), the interface looks good, so let's see how this goes.

Let me finish this post with some links to a few posts from coding horror by Jeff Atwood. If you are into programming, read his blog.
Update (3rd Sep, 2015): After almost two years of publishing this post, I am still using Notepad++, and I have to say that I am very happy using it. If you have not tried this editor (on Windows) yet, check it out.