In my last post I looked at some different IDE/editors for PHP. The feedback was overwhelming, I did not expect so much interest, which leads me to believe I’m not the only one in search for the holy grail.
I already gave a brief review of NetBeans, but a new version 6.9 Beta came out after I tested it, so I decided to take it for a spin. Over the last two weeks I’ve been using NetBeans as my main IDE at work, continue reading to see the verdict.
NetBeans 6.9 looks very promising. In it’s current state I’m almost sure my quest is over already – at least I will choose it over Eclipse PDT for now.
Out of the box NetBeans comes with all the features you would expect from a modern IDE. It has very good and quick code completion, good file navigation, very nice HTML/CSS support, Subversion integration and much more. Basically – everything I need except for Git support, but not many IDE’s fully support Git yet anyway, so I’m fine doing it in the terminal.
I was surprised to see that XDebug support was working almost out of the box – it even gave detailed instructions on how to set things up, which was quite nice.
The autocomplete is spot on. It’s very fast even with large projects, which is where Eclipse PDT keeps me hanging, waiting several seconds before giving me hints. It also includes information from PHPDoc blocks, which is very nice when working with larger frameworks like Zend Framework. The only time I experience some latency is completion on class names when initiating objects. However I have experienced some errors with the code completion. It seems to crash a few times if you try to complete an object inside a method call, but I have not been able to find a stable way to reproduce it. I’m sure the NetBeans team will figure it out before 6.9 is released.
NetBeans still has some strange things when creating a new project. If you plan on checking out source from SVN which does not contain a NetBeans project, you will spend some time wondering what the heck happend to the files you just checked out. Eventually you get to work, but the next time you need to checkout a project you have forgotten all about it. I can live with this, besides it’s only until I get all my projects to contain the NetBeans files, then there is no problems at all.
The new beta also fixes a very annoying issue for me, the ability to change files outside the IDE. I use Doctrine alot, and when running scripts from the terminal to create models, this just needs to work. NetBeans 6.8 did not work for me, but in 6.9 this all works perfectly. They even added a “Scan for external changes” in the “Source” menu. The only thing I could wish for is to add a shortcut for this feature.
NetBeans enables you to customize your code style, where to put braces, spaces, tabs as spaces etc. I see this feature in a lot of editors, but it’s a nice feature to have. One note about this, is that I only seem to be able to specify for PHP. I’d like to either have those rules applied to Javascript as well, right now it just seems to ignore my settings.
Editing HTML, CSS and Javascript is really nice. They added some powerful tools, among them is the ability to refactor inline CSS to external CSS files. I have a very bad habit of writing a lot of inline styles, now I can easily refactor this to external files. Simply mark the HTML -> Right click -> Refactor -> Extract Inlined Style. Choose your file and preview the changes, you can see the changes to both the HTML and CSS files. This feature really, really rocks!
One thing to remember is that NetBeans 6.9 is still in beta. This means there will be some bugs and random crashes. I have experienced a few crashed, but nothing major and most important – no work was lost.
Overall I would say NetBeans 6.9 looks very, very good. It has some bugs and downsides, but as I concluded in my last post, it really comes down to personal preference and which downsides you can live with. For me, NetBeans seems like a huge improvement over Eclipse PDT. I will continue to use NetBeans at work, at home I will look into some other interesting IDE’s including Komodo and JetBrains PHPStorm.
I still have not come to accept Netbeans fully as my IDE of choice for PHP since I still love to design my web applications visually. For that I use Dreamweaver, and with CS5 PHP coding support has vastly improved, although it still can even compete with Netbeans 6.8
I’m waiting on the final of Netbean 6.9 before I upgrade, and I hope perhaps then I can switch fully. But I know I will certainly go back to DW since I have been using it way longer than Netbeans. Old habits are hard to break, lol!
Did you try NbGIT (http://nbgit.org/) ?
I looked at it, but I haven’t tried it out. It seems to be based on the same plugin that Eclipse uses, and while it looks promising, it still needs some work. But I will test it out, would be nice to have some basic features (ability to commit locally and stuff) from NetBeans, and I’m fine with using the terminal for more hardcore Git stuff
Yes, the git support is not bad, but not all is supportet.
In Base coomits and updates are supportet. branching i havent seen till now, but it could display all Commits and branches in an special browser like git-gui.
But i prefer myself to use git-gui for the most tasks, its the best gui for git i have found till now.(but supports also not all, like submodules)
I haven’t been able to get NBGit to work with 6.9 Beta. It seems the latest release was in september 2009.. I also found a bug report on the NetBeans Bugzilla (http://netbeans.org/bugzilla/show_bug.cgi?id=131531) requesting this feature. It’s been a couple of years since the demand for Git started growing, I think it’s a little weird that most IDE’s haven’t adopted it yet. Anyway, back to the terminal to commit some stuff
I only use Netbeans, I can’t stand the mess that is Eclipse plugins. I have actually convinced most of the people in my office to use Netbeans too… which is great. I think a lot of the bugs/slowness in the Beta are actually because they have a debugger running in the background to catch bugs making the IDE take too long to respond to commands.
Indeed, but even if they have additional debugging set in the beta, it still performs much better than Eclipse – at least for me.
Next stop for me is to get my colleague to switch away from Eclipse, all my friends have already switched
> NetBeans still has some strange things when creating a new project.
Have you reported it [1]? Otherwise it cannot be fixed…
[1] http://netbeans.org/community/issues.html
Actually I haven’t, mainly because I haven’t tried enough times to figure out if it’s just me or it is a bug. I will look into it later this week and report if it is indeed a bug
Then, you shouldn’t write such things in review
Well the problem is that it’s a bit different from other IDE’s. I would expect the “New project” dialog to assist me checking out from subversion – AND create a project on top of that, but I can’t. I have to manually check it out from the Subversion menu, find the correct place to put my files, THEN create a new project with existing sources.
The new project dialog always defaults the path to my MAMP location – this annoys me, mostly because I can’t change it. So as a user I will get confused about where to put the files.
The proper way would be for netbeans to allow me to create the project first, and then allow me to check the files out – all in the same process, without having to tell where the files should be located 2 or 3 times.
After I check out the files I can choose to scan for a project, but if there is no “nbproject” in the source, I’m not given the option to create one..
I played around with it yesterday, and I can’t really classify this as a bug, but it would make a good feature enhancement.
Out of interest, why is it considered a bad habit to use inline CSS styles?
Well I’m not sure there is any official thing that says inline CSS is bad, but it will make your life way easier. Inline CSS hacks are OK, my problem is that i usually do all my design inline. Imagine having some inline CSS you use three different places, maybe it’s a border around a box, width, height etc. Now you need to change it. Booooo, now you have change it three places instead of one.
Inline CSS is bad for the same reasons that mixing markup and code is bad.
Let’s say you pepper your code with inline span styles to turn word x green. Now, it’s a year later, and you want word x to be red. If the css is inline, you have to change all those styles by hand – if it’s external, you should be able to change one line of code and the whole site will change.
In a nutshell, it’s the same principle of abstraction that applies to other coding practices.
Exactly what Marcus said!
Kind of the same reasons why OOP was developed in the fisrt place, or why is a bad idea to have “magic numbers” or hardcoded strings for things like messages or file names. By using variables or constants instead of the actual thing will allow you to go to a single place to make the modification and that change will propagate.
It is a smart trade of, “waste” a couple of extra minutes to code the lines now and save several minutes down the line when you have to chance something.
If the project is small you will not feel it much, but when you play with biggers things it will be noticeable almost inmidiatly.
My advice is do it even on small project so you get the hang of it and then it will come automatically when you do more complex things.
Thanks for the report, Ole!
I love NetBeans but one feature I find it to be severely lacking is (S)FTP synchronization. I know that people are moving to SVN/CI servers to push code from development to production but some of the hosts I use don’t support SVN.
Did you try creating a project with remote source? It actually works OK with both FTP and SFTP. The only problem is that it has to fetch all the files down to your machine, but it uploads the files when you save. I really enjoy this feature when I need to edit some things on remote hosts where I don’t have ssh access.
I do realize it’s not a sync feature, where you can manually sync up/down while working locally, but it’s better than nothing. I still haven’t been able to get it to work in any form in Eclipse anyway, so this is a huge improvement for me
Netbeans is still a bear for remote editing.
Took me 20min to download a project over a LAN before I could start.
Is it just me or does ZDE 5.5 still feel like it has the best remote editing 5 years later.
From your first screenshot it looks like you are running the beta under OSX. So if that is the case, have they fixed the chronic, chronic memory leaks under OSX? I was using Netbeans 6.8 but had to leave it because after 4/5 hours of continuous usage it would suddenly spiral out of control and stop responding with the memory usage going berserk (>700MB) and all components would stop functioning. The only way out was to force quit it. There were several posts to the bug tracker about it, but I’ve not been follow them – I have to work.
Ended up going back to Zend Studio 7 and all of its problems. Want to crash it? Just starting browsing a projects folders while the DLTK indexer or SVN cache is running. 9/10 times it will crash on both Mac and Windows. Urgh!
Well I’m not sure if it’s because it’s in beta, but there is a memory-meter in the top, which indicates the memory usage. I’ve paid close attention to it, when working with larger projects, it can consume 350-400MB ram, which is just fine with me. I’ve been at the office for 10 hours straight, and it still didn’t grow over this, so I believe they fixed it. – Oh and the nice thing about the mem-meter is that when you click it, you force a garbage collection and it reduces the memory usage
I really think you should give it a try, I’d hate to go back to Eclipse now :/
Yeah…NetBeans is Really awesome also for writing JavaScript basically it was made up for JavaScript and i really likes this software it helps alot far more than DW which i started to used in first place then when i knows about NetBeans i moved to it and still on it.