Why I use Netbeans for PHP (and you should too!)

I spend a good chunk of my time at work coding in PHP. Netbeans makes my life so much easier and I thought I should write about it so I can spread the message 🙂

Of course in the Microsoft world, Visual Studio absolutely rocks and beats out the competition by several galaxies! But then, it does cost a sizeable amount, is narrower in scope, and is not open source.

Over the years, I have tried out a gamut of programming IDE’s for PHP – Zend studio, Aptana Studio, Eclipse PDT, Komodo, VS.PHP to name a few.. None of them *completely* satisfied my requirements. Netbeans originally started of as a Java IDE but over the years, it has blossomed into a stellar web IDE. I started using Netbeans with version 6.5 . It has indeed made great strides since then.

Some of my reasons for sticking with Netbeans are:

  1. Truly universal : Netbeans runs on the Java runtime,and  so works exactly the same on Windows, Linux, Mac etc. Loads up in around 10 seconds. Stable as a rock. The PHP only IDE is a 25 mb download (comparatively lightweight) and installs in 99 MB hard disk space. Currently, I have Netbeans 6.8 installed on XP at my work, Win 7 at home and Ubuntu 10.04 on my laptop.
  2. Well-rounded IDE : Auto-complete, Syntax check, Syntax coloring, Formatting, Debugging – These, I believe, are the main pillars of an IDE. Netbeans handles them all with aplomb. I routinely use PHP, Zend Framework, Jquery, CSS, HTML, and Netbeans crunches them all effortlessly.
  3. Seamless integration with my preferred version control system – Mercurial. The ability to ‘time travel’ with Hg is phenomenal! I encourage everyone to check it out. Netbeans’ diff screens are a thing of beauty.
  4. Integration with PHPUnit – PHPUnit is the de facto testing platform for php apps. Netbeans makes the test-code-refactor routine fun! Code-coverage reports are also built in.
  5. Support for DocBlock Commenting – Netbeans supports DocBlock code commenting. It is easy to customize templates to include standard (file/class level) docblocks. Typing in /**(return) before a function automagically builds a docblock template for you. A great time saver!
  6. Code Templates/Snippets support : This is a great time saver. I have about 100K of snippets stored away on my computer. What’s more, they can be exported/Imported and used on any workstation. It helps abstract out all the boilerplate code. So you only have to focus on the main job. My only complaint is that there is no auto-popup/intellisense for code templates. After a while, it becomes a bit taxing on brain to keep track of them (Tip: use a good naming convention).
  7. Smooth functional screen layout : The IDE uses a familiar layout, and placement of all panels is intuitive. This is one of the reasons Eclipse based IDE’s lost out (‘Perspectives’ freak me out!)
  8. FREE : Yeah.. Absolutely free! what else can you ask for? A world class IDE available for absolutely nothing.

Netbeans is definitely a keeper.

3 thoughts on “Why I use Netbeans for PHP (and you should too!)

  1. It’s really interesting how you did not say much about debugging. Cuz if you do debug your apps, then capabilities of PHPEd simply cannot be surpassed.

    1. I have not used PHPEd and so I cannot comment about its debugging capabilities.. but I did mention that Netbeans handles PHP debugging very well (In fact, it would not be a true IDE without debugging support!). It requires the XDebug PHP module installed.

  2. The biggest problem with Netbeans is its so-called support for “remote file editing” (or “Remote projects”), where Netbeans assumes a god-like position/view on how it handles files. I work from three different workstations/computers/laptops, and it really has some serious issues when it comes to “external” modifications to files it thinks it owns.

    Netbeans is a wonderful product and this is my only serious issue with it. In all other aspects, I would recommend Netbeans over most other similar products I’ve tried.

    A “nice-to-have” feature would also be to be able to open a single remote file without having to create a gvfs or similar mountpoint in the OS, or create a remote project in NB.

    Komodo IDE 6 is looking very promising; it’s not free, but neither is my time.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s