NetBeans – a PHP IDE for the VS crowd

Pavel Lutskovsky

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:

  1. 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?
  2. 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.
  3. 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.
  4. 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.
  5. Decent javascript and CSS support.  I don’t spend a lot of time on them since I mostly do backend work, but it’s nice to know code completion, documentation and even CSS preview are available.  These are not my strong suit and it’s nice that NetBeans gives me a crutch with them.

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.


3 Responses to “NetBeans – a PHP IDE for the VS crowd”

  • Ethan Knowlton Says:

    I recently spent the last year trying to get a good grasp on Eclipse and I still don’t fully understand all the features. Not to mention the random errors I get when trying to achieve a menial task.

    Having used Netbeans IDE for alot of java editing, I recently switched to it for my PHP projects. I also don’t plan on looking back.

    All I really want is a simple editor that I can understand with the some of the essential abilities like (S)FTP access, project management, code walking as you put it, and code completion and I think Netbeans does it all.

  • e4c5 Says:

    You are dead right, netbeans sucks but it’s a lot better than any of the other free IDEs and even some non free ones.

    What I find most disapointing about Aptana is the missing ‘find usages’ feature of Netbeans.

  • Stas Says:

    I prefer Codelobster PHP Edition (http://www.codelobster.com). It works best for me and has many plug-ing for frameworks.

Leave a Reply