Until I switched to Ubuntu as my main development environment a few years ago my favourite IDE for PHP development was E text editor. To be honest, I have never really been 100% happy with an IDE; there always seems to be something missing. In the case of ‘E’ it was the lack of a stable linux version. My Linux favourite lies somewhere between GEdit and Geany however they lack the super cool features you get with a full IDE.
Essentially what I am saying is when it comes to IDEs and text editors I am fickle.
So recently I tried a couple of alternatives. Full IDEs. A colleague of mine, who we shall call Mr Eclipse, used Eclipse. I have always hated Eclipse for some reason and it soon became one of my favorite things to say ‘see, eclipse is crap’ every time he had problems with it (which was fairly frequently). I decided to put my unfair hatred to one side and try it out for myself for a while. Unfortunately something just wasn’t quite right, it seemed slow I found myself going back to GEdit when i actually needed to get some work done, not really a good sign – IDEs are supposed to make life easier after all.
So then I discovered NetBeans and – for now at least – it has become my go-to editor when working on full projects – I still use GEdit for quick note taking (Friday pizza orders for example). So here is a quick list of a few features that I really enjoy about NetBeans along with some super-short videos of them in action. These are the things I show my colleagues when I am attempting to ‘convert’ them. Mr Eclipse is a prime example, since I showed him ‘Local History’ he has been using NetBeans as well and a few more have also started to try it out.
Docblocks
I like documentation, I have to be honest. When I see a nicely laid out class complete with doxygen/PHPdoc style docblocks it just makes life that little bit nicer. Writing the stuff on the other hand is a pain in the backside. NetBeans has a nice feature which helps reduce the monotony a little – if you start to document a function it will automagically add in the attributes for you.
Example of NetBeans Automatic DocBlock Stuff
Picking up PHPdoc/Doxygen documentation
It is all very well having API docs generated from source but what about when you’re in the flow of coding and you can’t bare to switch from your IDE? NetBeans saves the day again by displaying large help tool-tips as you type generated from your docblocks. The best way to understand is to watch the example below, in short though – its cool.
Example of NetBeans Displaying Documentation
Refactor… Rename
Refactoring has been a very a hot topic recently at work, and I believe it to be a highly important discipline for any project that is going to maintained by many people over a long time period. A rename is a simple refactoring admittedly but it is nice to have a feature in your IDE that makes it easy and visible.
Example of NetBeans Refactor… Rename
Automatic Method & Variable Creation
You know how it is, you’re writing some code and you realise that you need to call a function or access a variable that doesn’t yet exist. NetBeans helps out here – it spots a call to a method or a reference to a variable that doesn’t exist yet and non-intrusively offers to create it for you. Not only that, if you supply some attributes in your function call it also takes those into account when creating the code.
Example of NetBeans Automatic Variable Creation
This also works for methods:
Example of NetBeans Automatic Method Creation
Local History
Now this is super awesome; it is basically like having local source control built into your IDE. Essentially it allows you to see a diff between your current code and earlier versions and gives you options for merging and reverting. Everything is nicely laid out and easy to follow and it’s an absolute joy to use when you have just realised that you did need that code you deleted 5 minutes ago after all.
Example of NetBeans Local History (beware, this one is almost 2MB)
So thats your lot! 5 cool NetBeans features. This is by no means all of NetBeans‘ best features and in fact after a few more weeks of using it I might post a follow up with some more. Or maybe I’ll be on to another IDE by then!