Pages

Wednesday, February 8, 2012

The Great IDE vs Text Editor Debate: Why I Switched Sides

There are two types of programmers; those who prefer full featured IDE's and those who prefer a lightweight text editor.  I used to be firmly planted in the IDE camp happily opening CFBuilder, CFEclipse, or Aptana every morning to work on my ColdFusion, PHP, and Ruby projects.  Recently however, I have switched camps.  I now have SublimeText 2 and a Terminal open whenever I code and this post will try to explain why I made the switch.

In this corner, the IDE

Sears Mechanics Tool Kit
Let me start by defining what I believe an IDE is. To me an IDE is a prepackaged toolbox with many of the tools you'll need for a job.  Its a lot like the Mechanics Tool Tool Kit from Sears.  In it you get here all the tool necessary to complete the basic tasks a mechanic does.  Two things stand out here, what you don't get, and the fact that you have to lug around all these tools just to get to one single wrench.  Is that socket driver the highest quality tool you can buy at Sears?  Likely not.  Yes, CFBuilder has code insite and intellisence, however it was often a bit too slow and a bit too buggy for me, sometimes it worked, sometimes it didn't.  I never got the feeling that it was actually helping me code faster.  On the other hand knowing the names and types of arguments on my components is awesome and definitely something that I had to be willing to give up when making the switch to a text editor.  Guess what? I don't miss it one bit.

I also use SVN and GIT as my two primary means of source control.  While subclipse or subversive were nice, they rarely worked 100% of the time, especially when I made the switch to a Mac.  I had problems checking projects out where after going through the whole process of setting up the project eclipse would never bring any of the code from the repository so I'd have to start all over.  On my Mac it was a total crap shoot when I'd try to synchronize.  I also tried to use some of the SQL tools inside of Eclipse as well (I think I even blogged about the SQL Editor in CFBuilder once) but I never found them quite as useful as the external SQL tools that I regularly use.  Additionally I used the console view in my IDE quite a bit to write debugging output, this feature is nice, but is easily replaced by tailing a log in the terminal.

Lastly in order to support all of these areas of functionality an IDE needs to use lots of screen space.  When I'm coding I like to see two things: the folder structure of the project I'm working on and the code itself.  When I was using an IDE I found myself constantly readjusting the windows within my workspace.  Maximize the code, minimize the code, show the console, show the server, team synchronization view.  It was distracting to say the least.

Making the Switch


While I was happily coding in my many flavors of Eclipse I'd see many developers talking about Textmate, Notepad++, VIM, and EMACS.  I'd frequently half heart-idly try out E (textmate for windows) but I'd always go back to CFBuilder after a short time.  While I found that I liked the look and feel of these a bit better than Eclipse I failed to see what all the hype was all about.  The first "a-ha" moment I had was when I  was using E and typed in cffunction -> tab, then I pressed tab again.  OK, this is sort of nice, I can fill out a whole tag and cycle through all of its attributes by pressing tab.  This was nice but when I write functions I don't always use all the attributes.  The next step I took towards text editor bliss was to customize the snippits I used the most to match the way I wrote my code.  Shortly after I was writing code faster than I ever was before.  Little by little I started to use E more than CFBuilder and Aptana.

In this corner, SublimeText 2


Snap-On Torque Wrench
This brings us to the point where I installed SublimeText 2 on my machine and started playing with it.  This article on Nettus+ changed things forever.  One of the things I really liked in eclipse was using Ctrl-Click on a component definition in a file to be taken directly to that component in the editor.  I thought Ctrl-P was a lot like the "Open Resource" function in Eclipse, however, what I didn't know is that SublimeText will instantly preview a file in the editor as soon as it gets focus in the search result list.  SublimeText also remembers what files you recently worked on so those files come up first in the file list.  I was finding and opening files faster than ever.  Adding the power of Ctrl-R to quickly find a function in a file I can go to a specific function in a component faster than I can by doing a ctrl-click in eclipse.  SublimeText is the Snap-On Torque Wrench of code editors.  It does one thing and it does it extremely well.  

Additionally now that I wasn't using Eclipse for everything I had to find alternatives for the other things that Eclipse did for me like SVN, GIT, Ftp, and viewing log files.  For the most part the replacements I found have far outperformed what was available in Eclipse. For instance on my Mac Cornerstone has been a great replacement for the SVN integration in Eclipse.  I love the incoming/outgoing file count.  I have less conflicts now because I can see when files are waiting to come in and update more frequently.  There are situations where the eclipse plugin outperforms it, but those are far and few between.

Lastly are the intangibles that make SublimeText a pleasure to work with.  For the first time in my career I have found an editor I am passionate about.  An editor that, for me, makes coding more fun.  Its the little things that make such a big difference.  I love the animations when I close a tab or delete a file. I love the 30,000 foot view of all of my code in a file, I love how the contents of a folder smoothly slides down when I click on it.  I also love how easy it is to pull in a color file and have those colors work on all my code instead of having to import 15 different .col files like I did with eclipse.

Conclusion


In conclusion I'd like to say that no text editor or IDE will make every developer happy.  Each developer should use whatever makes them happy and productive.  In the mean time I'll continue to sing praises of Sublime to whomever will listen.  But who knows, when CFBuilder 3 comes out I'll probably switch to that for a bit simply because I love trying new things.