Netbeans for PHP: Continues to Impress

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

Comments
  • Miles Johnson
    Posted February 2, 2010 2:11 am 0Likes

    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.

  • Philip Hofstetter
    Posted February 2, 2010 2:43 am 0Likes

    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
      Posted February 2, 2010 8:00 am 0Likes

      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

  • Narendra
    Posted February 2, 2010 3:09 am 0Likes

    Netbeans is getting better but still I am waiting for ‘hover tips’ as in eclipse and ZDE.

  • Goran Miskovic
    Posted February 2, 2010 3:55 am 0Likes

    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
      Posted February 2, 2010 8:02 am 0Likes

      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

      • Goran Miskovic
        Posted February 2, 2010 1:20 pm 0Likes

        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. :)

  • Derick
    Posted February 2, 2010 5:15 am 0Likes
    • Davey Shafik
      Posted February 2, 2010 8:03 am 0Likes

      Let’s hope that OSS never dies, rings true :)

      – Davey

    • Goran Miskovic
      Posted February 2, 2010 1:32 pm 0Likes

      As far as I can understand Oracle has no plans invest into Eclipse PDT but in NetBeans PHP support. Development of dynamic languages plugins is completely moving to community and they plan to invest in infrastructure needed by community.

  • Jordan Walker
    Posted February 2, 2010 9:02 am 0Likes

    I love NetBeans for PHP development, Eclipse of ColdFusion, and Notepadd++ for everything else.

  • Jamie
    Posted February 2, 2010 9:14 am 0Likes

    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.

  • John
    Posted February 2, 2010 9:14 am 0Likes

    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.

    • Devis
      Posted February 3, 2010 6:29 am 0Likes

      I had the same issue and solved it upgrading Java (ubuntu 804)

  • Brendon
    Posted February 2, 2010 11:55 am 0Likes

    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?

  • Trackback: How to make Netbeans use tabs for indention | OpenSourceEditor
  • Sorin
    Posted February 2, 2010 2:39 pm 0Likes

    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

    • Jozef
      Posted February 3, 2010 1:55 am 0Likes

      Have you tested the upcoming JetBrains Web IDE?
      http://www.jetbrains.com/webide/
      http://blogs.jetbrains.com/webide/
      I would like to know your opinion about best commercial PHP IDE.

    • Goran Miskovic
      Posted February 8, 2010 5:39 am 0Likes

      The only thing that I hate is the poor implementation of SVN. You must use a 3rd party software like Tourtoise SVN. ???
      How comes?! NetBeans SVN integration is working flawlessly.

  • Claudiu
    Posted February 2, 2010 3:18 pm 0Likes

    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
      Posted February 2, 2010 3:32 pm 0Likes

      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.

  • Ernie Leseberg
    Posted February 2, 2010 5:46 pm 0Likes

    I made the switch to Netbeans at version 6.5 and have not looked back. Very stable and responsive, an area some of the other java based IDEs fail in.

  • Keith Casey
    Posted February 2, 2010 8:26 pm 0Likes

    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.

  • someone
    Posted February 3, 2010 5:12 am 0Likes

    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.

  • andreas
    Posted February 3, 2010 6:25 am 0Likes

    I too find NetBeans an excellent solution for PHP.
    Too bad the Netbeans project will be dropped by Oracle.

  • Robert
    Posted February 3, 2010 11:16 am 0Likes

    I thought the remove whitespace issues was resolved in NB 6.5?

    • Goran Miskovic
      Posted February 8, 2010 5:43 am 0Likes

      Yes it is. Source > Remove trailing spaces

  • Ahmed Shreef
    Posted February 3, 2010 2:44 pm 0Likes

    actually, I did move to NetBeans after reading your previous post that compared many PHP IDEs and I’m still using NetBeans till now and some of my colleagues like it too.

  • dimis
    Posted February 6, 2010 11:18 am 0Likes

    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…

  • Meee
    Posted February 8, 2010 7:02 am 0Likes

    Netbeans is nice for small projects but it really sucks (perfomancewise) when the project is getting big.

    • Davey Shafik
      Posted February 8, 2010 7:22 am 0Likes

      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

    • Bruce Ingalls
      Posted February 8, 2010 12:51 pm 0Likes

      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 ;)

  • Bruce Ingalls
    Posted February 8, 2010 12:34 pm 0Likes

    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)

  • Robert Kraig
    Posted February 13, 2010 12:32 am 0Likes

    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.

Comments are closed.