NetBeans – a PHP IDE for the VS crowd
I know I’m not the only PHP developer on the planet who despises Eclipse, refuses to pay for Zend and thus does most of their development in some text editor devoid of the basic conveniences of an IDE. At the same time, I’m not the only PHP developer who spends quite a bit of time in the .NET world being spoiled by VisualStudio and ReSharper’s conveniences.
I’m sure this makes me a Microsoft sellout on many levels, but I’m not ashamed to admit it. Visual Studio (despite its many flaws) is the best IDE I’ve ever used. No it is not perfect. Yes I curse at it daily (no different than the mechanic cursing a wrench he’s used for years). But I get my job done. I don’t have to jump through too many hoops to do it. I just need an average machine with Windows. The combination of Visual Studio with ReSharper is what allows me to stop worrying about using software and focus on writing good clean code. Yet for my PHP work, I’ve been stuck to Notepad++ and vi for too long.
Since I paid quite a bit for VisualStudio, I’m not too interested in dropping a lot of money on another IDE, so for the purposes of this comparison, I looked at free products. Until recently, my choices came down to decent but not user-friendly IDEs in the Aptana/Eclipse vein, half-baked free IDE versions of a paid product (Komodo) or a simple text editor.
For small things, Notepad++ and vi are still my go-to tools. But for the big stuff, the glamor (or lack thereof) of being known as the guy who codes in Notepad++ is finally gone. Good riddance. Since picking up NetBeans 6.5 in RC mode I haven’t looked back. Bottom line: NetBeans gives me an IDE where I can focus on my code rather than on learning how to use some oddly designed beast (Eclipse). Yet, being an IDE, I have the conveniences I’m used to from my .NET development.
Here are a few of my favorite things:
- Code completion – all IDEs have this, but NetBeans is better for someone used to VS. Full documentation for standard functions and linked files is made available with a simple keyboard shortcut. Aptana’s and Eclipse’s default code completion is laughable. Just listing the name of the function?
- File browsing - just like in ReSharper, hitting a simple keyboard shortcut (Ctrl-O) to browse by type (and it takes CamelCase, whoohoo!) makes moving around in a large project incredibly easy. The completion also takes into account linked code (i.e. PEAR, CakePHP, CodeIgniter) types. Ctrl-Shift-O lets me browse by filename. No more hunting for files across library directories. Ctrl-Alt-Shift-O browses by method.
- Search usages – surprisingly, even the shortcut is the same as my ReSharpered VS installation, Alt-F7. I get a list of every instance of the variables usage across the project. No more grepping and checking context to see if it’s really a different variable by the same name.
- Code walking – Ever since my Delphi (Borland studio) days, I’ve found Ctrl-clicking a variable or type to go to declaration indispensible. VS doesn’t do this by default, but thankfully the guys behind ReSharper thought of this. To my surprise (or are they reading my mind?), the guys at NetBeans did too. Clicking a function’s usage takes me straight to its declaration. What could be simpler? Aptana, take note, when I accidentally click on “require_once”, don’t take me to the file that’s being included.
To be fair, NetBeans isn’t perfect. The CamelCase support for type browsing, CakePHP support and the SVN plugins could be improved. Still, it’s the best free tool I’ve seen. It fits my needs, as a guy who spends at least 40 hours a week staring at Visual Studio and wondering why PHP IDE’s are so far behind.