Netbeans for PHP: Continues to Impress

Standard

It seems that I don’t blog much unless IDE’s are concerned; there is a good reason for this: IDEs are an integral part of my development process and when they suck, development sucks.

The story so far:

  • Boy meets ZDE 2.5
  • ZDE grows up to 5.5
  • ZDE gets replaced by new eclipse-based ZSfE/PDT
  • ZDE keeps going, until one day, Boy upgrades OSX
  • Boy hacks OSX, but ZDE is running on a donut
  • OSX update kills ZDE for good
  • Boy cries
  • Boy finds Netbeans

This is the continuation of that story. In the last installment Netbeans 6.7 was a nightly build, it had gotten it’s OSX look and feel, and it was starting to get it’s remote debugging up and running.

Now, 6.8 has been out for almost 2 months, and things are really starting to gather steam. With the death of ZDE5.5 finally a reality, and PHP 5.3 code starting to become part of my work-day, I finally jumped 100% to Netbeans.

And let me tell you, Netbeans 6.8 is nothing short of amazing. Debugging with xdebug is now almost as easy as ZDE, it works instantly on 90% of my remote machines, but I have 1 cluster for which Netbeans simply *cannot* find the local source file, making it impossible to debug.

Watches, breakpoints (though, I haven’t figured out conditional breakpoints, if they are there), callstack and local variables work as you would expect (though watches/variables sometimes refuse to populate larger vars, I think this is xdebug config related). In addition, Netbeans supports arbitrary breakpoint groupings; these can be enabled and disabled as a group — very neat.

In addition, it has path mapping to help with remote/local file correlation; so it can find the local file to show the source during debugging — this stops the problem ZDE has where two files have the same basename() and it’s unable to choose the correct one.

However, a fully functional debugger is a minimum requirement. Netbeans 6.8 also has great support for PHP 5.3 (though it has some syntax support bugs), again another minimum.

So where does Netbeans shine? The single biggest answer to that, is PHPUnit support. Netbeans lets you specify your test folder, and abstracts it out of the project, so your tests are separated visually; this is a great minor addition. In addition, Netbeans can generate unit tests (this utilizes phpunit’s built-in functionality), and has a great UI for running tests.

You can run a single unit test by simply right clicking on the test and choosing Run, or you can test a whole project by right clicking on the project and choosing Test. Doing this will bring up the Test Results pane:

As you can see, it shows the number of tests, the test suite, and it’s test status; this can then be expanded to show individual test methods.

Further to this, you can have Netbeans capture code coverage information, if you have the xdebug extension installed locally. This then manifests visually in two ways; the first, is a summary:

The second, more impressive/useful way, is visually within each file:

You will also notice that this adds a set of buttons below the code, which can be used to run the test for just the current file (based on the typical phpunit file/test naming structure, I assume) and to re-run the entire test suite.

To me, this integration is phenomenal, and is changing the way I work. This is a great example of an IDE conforming to your workflow, and proving new ways to do things; rather than fighting you and requiring you to change to it’s needs and ideals.

Other things of note, Netbeans 6.8 has Symfony project integration, and 6.9 is including Zend Framework integration, if those things appeal to you — I have yet to play with either, so can’t comment on their usefulness.

I can, without doubt, confidently say, that despite the few bugs, and some still immature minor things, Netbeans is my recommendation for an IDE.

Go grab Netbeans today.

– Davey

37 thoughts on “Netbeans for PHP: Continues to Impress

  1. Agreed 100%. I switched to Netbeans from Eclipse/Dreamweaver about 6 months ago and haven’t looked back. With its awesome 5.3 support and its fast speed, it beats out Eclipse any day.

    I have yet to give the PHPunit combo a try, I really should now.

  2. As good as the debugger and function auto completion might be – as long as the actual editor lacks the most basic features, Netbeans is just plain not usable for me.

    I’m talking about a configuration what newlines should be used and an option to remove trailing space on save (which you can’t even add yourself by either writing a macro or even a plugin).

    At the place where I work, we have a policy that no file should be commited if it contains trailing whitespace, tabs or non-n-newlines. This keeps patches clean and readable and makes merging between branches a lot easier.

    This also means that I cannot use Netbeans.

    Unfortunately, bug reports to add these missing things get payed down or just ignored and especially the down-playing aspect makes me not even try to patch it in myself – if they are adverse to the functionality, what’s the likelihood of them accepting patches that implement the features?

    • Davey Shafik

      I’ve had a very positive response to all 4 of my tickets so far, so I don’t think your experience is the norm.

      – Davey

  3. I’ve moved from Eclipse to NetBeans a year ago and I did not regret my decision. NetBeans rocks.

    I think that ease of plugins installation should be mentioned. The only plugin that I spent more then a moment on installing, was Cubeon Trac repository connector. Even that was due to problems on the server side: Trac repository that I need to connect to was running on CentOs 5 which is coming with Python 2.4 and Trac XMLRPCPlugin works with Python 2.6 only.

    • Davey Shafik

      I too use Cubeon somewhat, very cool indeed; Mylyn was one of the only things tempting me to try and stick it out with an Eclipse based solution.

      – Davey

      • When talking about Cubeon/Trac integration the only feature that I am missing is the option to select issue (ticket) on commit. Fortunately Trac Estimation and Time Tracking plugin along with Subversion post-hook is quite good workaround. :)

  4. Jamie

    I switched from Zend/Eclipse to NetBeans when 6.5 came out and have been in heaven ever since. I do a lot of Drupal work and the Drupal plugin for NetBeans is teh awesome.

    The only thing I wish they would improve on is editing on remote systems. Eclipse has a plugin for this, but NetBeans doesn’t. You can achieve this ability with mounting an sshfs point, but the way NetBeans scans folders to index files, it can kill your IDE.

  5. John

    I like Netbeans, but the font looks pretty bad on linux compared to eclipse. I think it’s the aliasing. I noticed lots of google results with people having similar Linux+java+font issues. I think eclipse gets around it because of the different UI framework.

  6. Brendon

    May have to give netbeans another try. I really like eclipse pdt/zend studio 7.1, mylyn and tasktop are such great extension for eclipse i find it hard to develop without them. Hows git support in netbeans?

  7. I’m a IDE maniac (if I can say so) and tested every one I could put my fingers on: Zend 5, Zend 6 and 7(big disappointment), Komodo, Netbeans, Aptana and Nusphere PHPed.
    From all of those I remained only with Nusphere. From my point of view the best. Why?
    Because of: extensive syntax coloring, fast code hinting for php5.3, javascript, html and css, debugger, ftp and sftp integration and a lot more. The only thing that I hate is the poor implementation of SVN. You must use a 3rd party software like Tourtoise SVN. It has csv integration but I don’t really like.
    Just my 2 cheap cents :P

  8. I believe that the comparison should only be between Netbeans and Eclipse PDT since there are both free.

    I was a very big fan of Zend Studio 5.5, but when it migrated on Eclipse I was disappointed. I’m not saying that is a bad IDE, but I just don’t have the feeling that the IDE is working for me.

    It has bugs and it has issues, but since I’ve started using Netbeans 6.5 it has improved a lot!

    At work I’m using Zend Studio 5.5 (I don’t have a choice) but in the spare time I’m using Netbeans and I’m very happy with it.

    • Davey Shafik

      I disagree with you regarding comparing Netbeans/PDT because they are free. I am not even bringing price into the equation; it’s entirely about features – including how they work and how easy they are to use – and nothing else.

      Also, Netbeans has a commercial sibling in Sun Studio too (soon to be Oracle Studio/dead?), so the point is moot.

  9. Coming from a Java background, I’ve been an Eclipse user for years. When I added PDT, it was all useful but didn’t really seem to take the next leap. After you… and Tony Bibbs… and Ramsey… and a few others recommended NetBeans last fall, I finally gave it a shot.

    I set it up right around Thanksgiving and after a bit of transition time, it’s been 45+ days since I started Eclipse. The project spaces make sense, the php integration is seamless, and the debugging is great. The SVN browsing could use some work, but I realized that most of the time I didn’t *need* to browse SVN from within my IDE, I just got trained to.

    All in all, a +1 to this one.

  10. someone

    The problem is that Netbeans/PHP will die. Oracle won’t invest money into its further development but leave it to the community. Netbeans/Java will be further developed but only for Java SE. Whoever wants Java EE have to switch to Oracle’s JDeveloper.

  11. dimis

    I learn for netbeans from a book for java many years ago when it were young and were like an editor.
    Nothing remember that editor now.
    I wish just to support more php frameworks as yii and cakephp…

    • Davey Shafik

      I have over a million LOC open in Netbeans right now without an issue; what issues do you see? with what size project? On what platform?

      – Davey

    • As regards performance, I also have a project with about a million LOC.
      I noticed with the RC versions of NetBeans, that my hard drive would churn for half a day, indexing my files. Thereafter, and with the release version, NetBeans runs fast & light. Searches return in about a second or 2.
      Still, nothing beats the performance of vi ;)

  12. I like NetBeans, but the rest of my team uses Eclipse, as it has better support for proxying a remote debugger. I’ve not tried SSH tunneling yet, but we use Komodo-PythonRemoteDebugging aka pydbgpproxy (yes, it’s for PHP, too). This is to allow multi-user concurrent debugging.
    I’m surprised that you prefer NetBeans for remote debugging; it does not (easily) allow debugger proxy configuration, unlike Eclipse (and ActiveState Komodo)

  13. At all my previous jobs I’ve had, because i used netbeans i was able to run circles around the devs i was working with because of the intense integration. I will have to say though, if you are working with netbeans on a remotely hosted repo, where you are creating a project locally but remotely editing files say via samba, netbeans comes to a virtual crawl. The last major company i worked for, our project was well over 1+ million LOC. Netbeans is great if you are using working with files which are all locally based and somewhat standard compliant code using good coding practices, otherwise it will try to inform you about all the bad code in your repo. That is where the major slow-down hurts you. Not every large codebase is written by the best PHP coders / standards compliant coders on the planet, many coders hired by large companies are just CS majors who go from language to language like vagabonds. These are not PHP best friends.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>