Summary: I’ve used versions 6 and 7 of the NetBeans IDE for a long time. I like NetBeans, but it feels slow and clunky. So I decided to give SublimeText2 a try. I used SublimeText2 exclusively for two weeks, doing some relatively heavy PHP development work for a Drupal project. At the end of two weeks, I switched back. Here’s why.
By way of background, we build websites. In my working day, I need to be able to switch back and forth among a relatively large number of languages with different rules and syntaxes: PHP, Javascript, HTML, CSS (plus its SASS and LESS variants) and SQL. (My partner Lisa does all of our image editing, thankfully). Happily, there are several programs out there (IDEs) that can manage all of these files and provide basic syntax highlighting to make it easy for me to recognize typos and similar mistakes. And many of these programs let me upload my edits to a remote server without leaving the program, which is really handy.
When I started doing web development, I first tried the grandaddy of all open-source IDEs, Eclipse, then moved on to Aptana because it was more web-friendly. Aptana went through a buggy phase, lost most of its FTP capabilities and then kinda died, and I switched over to NetBeans, coming in at about version 6.9. I have been quite happy with NetBeans, and subsequent upgrades to NetBeans have mostly been improvements. But there has been a lot of buzz about SublimeText, and I was curious. My most recent upgrade to NetBeans 7.4, coupled with an ill-advised switch to 64-bit Java, did not go well, and spurred me to pursue my curiousity.
Although the SublimeText 3 beta was publicly available, after some research I decided to stick with SublimeText 2, since some of the plugins I was interested in had not yet been ported to ST3. Installation of the program and the plugins I wanted was smooth and trouble-free. (I should note that unlike NetBeans, SublimeText is not free. But given what I do all day, I would cheerfully pay the very modest purchase price if ST made me even remotely more efficient.)
SublimeText is fast. For a variety of reasons, my project files usually sit on a network file share. NetBeans does not like this much, and it can take 1-2 minutes merely to open an existing project (yes, I timed it). Scanning a new WordPress or Drupal project can take several more minutes. SublimeText, on the other hand, has no problems. It opens projects and folders instantly, and I can start working immediately. Even after it opens and indexes a project, NetBeans can pause from time to time — you can keep typing and hope it catches up; some times it does, sometimes it doesn’t. No such issues in ST. I should note that my Windows 7 workstation has a lot of RAM, an SSD, and an i7 chip. Programs should fly on my machine, and most do. NetBeans flies, well, some of the time.
[Update: Version 8.0 of NetBeans came out relatively recently. The NetBeans folks claim it’s much faster. I haven’t had a chance to take it for a spin, and I will update this when I do.]
SublimeText is pretty. In contrast to other IDEs, ST puts much less stuff on the screen, presumably to help you focus on your code — distraction-free programming, as it were. ST emphasizes keyboard use, which is great if you know what you want. Even during my learning period, I still found opening files and navigating around the code to be fast and reasonably intuitive (although I found I missed the NetBeans code navigator). I’m sure I would have gotten better at it over time. NetBeans, by contrast, is not pretty. And although you can create keyboard shortcuts for pretty much anything, the traditional windowed interface really invites you to use your mouse. In normal use, SublimeText just plain feels better — it’s easier on the eyes, and faster and more fluent for the hands.
So why did I switch back? The short answer: I’m too stupid.
We use both WordPress and Drupal a lot for our web development projects, which means I need to be fluent in the functionality provided by both systems. We even do a bit of web development using Symfony (which is way more fun than either WordPress or Drupal). Each of these different frameworks requires me to know how to use hundreds of different classes and functions — I need to know the properties and methods of objects, and the arguments to and return values from all of those functions. That is a lot to keep in my head, and, by and large, I don’t. NetBeans helps me in ways that SublimeText just can’t. Yup, I’m talking about code completion and context-sensitive help. NetBeans has it, and it’s good. SublimeText has a little of it, and it’s not good enough.
In the NetBeans PHP editor, I can create a PHP object from some class buried deep in my project, type its name, and up pops a list of its properties and methods. I start typing the name of a function and, barring those annoying pauses I mention above, NetBeans starts offering me alternatives. For each method and function it knows about, which includes every method and function in my project, NetBeans gives me the PHPDoc block, if any, as well as the argument signature (as a direct result, I now document my own code religiously — nothing like getting immediate benefit to prod you to do what you should do anyway). Click an icon (there’s that mouse again), and NetBeans takes me to the source code. For native PHP functions, NetBeans presents a slimmed down description, and again argument signatures and return values. If I decide to change how one of my own functions works, NetBeans will track down the existing usages so I can be sure I don’t break anything. Finally, NetBeans immediately flags syntax errors in my code, as I go. In short, wow.
SublimeText does very little of this out of the box. It can quickly jump to where a function is defined or used in the form of a quick symbol lookup. But it only finds symbols in files you have open, and it doesn’t differentiate between places where the function is used and the place where the function is defined. To add insult, you have to type the function name, again, in order to perform the search. (I gather that SublimeText3 will let you find symbols anywhere in your project, which is great, but you’re still typing the function name twice). There are, of course, plugins. CTags provides good support for finding functions (and other symbols) throughout a project, and it does differentiate between definition and usage, but there’s no code completion or immediate pop-up help. SublimeCodeIntel is an effort to port the code completion module from the Komodo IDE. This never worked particularly well for me; it was slow, and provided limited information even when it did work. There’s a PHP error checking plugin, but again, much slower than NetBeans. A real time error checker can get really annoying if you’ve typed several more lines of code before it finds the problem in the first line.
At the end of the day, it appears that SublimeText is faster than NetBeans mainly because NetBeans is doing a lot more for me behind the scenes. I can conceive of projects where I’d prefer the SublimeText approach. But for the work I do every day, it’s back to NetBeans I go.