Over the last 8 years I’ve tried out a lot of different setups. I’ve always loved Emacs, and for many years my setup was very basic: Linux/FreeBSD desktop,Fluxbox, Xterm, Emacs and Firefox - simple and powerful, and I loved it but I want more. I want my environment to be a bit smarter and not just provide me with some (very, very nice) shortcuts for navigating my code. About 5 years ago I started thinking there might be better tools/IDEs than Emacs. So I started my quest..
I realize this topic may start an epic flamewar, and I tend to give a bit too negative comments on some things, but that’s just me. Please keep in min that I’m open for everything. Vi/Vim/Emacs? No problem. Eclipse? Maybe. NetBeans, maybe… but do they live up to my requirements?
For the perfect development environment I have a few requirements:
- Must run on Mac
- Code completion for PHP
- Syntax highlighting
For years I’ve been using Eclipse PDT, but it’s starting to get slow. Autocomplete takes 3-4 seconds, and overall I experience issues renaming files and other small bugs.
I started looking around, there are some nice products on the marked. I loved my old setup with Emacs, so I really hoped to find a code completion plugin for it, or maybe Vi/Vim. NetBeans is a player on the marked and certainly worth checking out. So I spend many nights playing with different editors and IDE’s. Here is a summary of the results:
Overall HTML+PHP modes provides an excellent tool for my needs. Code completion isn’t good.
I was able to find tools like Autocomplete.el + etags which initially looked good, I was able to get code completion for everything, but not in a good way. Emacs + Autocomplete.el + etags was able to provide me a list of all methods in my entire project, the only problem is that it’s not context aware.
Emacs was not able to figure out where I was in the code or which variables/classes I was working on. On another note, etags is not the perfect solution, because you have to run and generate a new tags file every time you change your code – however I can live with this, but I can’t live with it not being to detect the context I’m trying to complete.
VIM 7 has some very nice features. They even provide code completion out of the box. VIM takes some time getting used to, but comming from Emacs, I’m used to weird shortcuts and key combinations. Overall VIM was better than Emacs, it could provide with me some in-buffer completion, but still nowhere near perfect. It could do basic completion on the variables and methods on objects, but it is still not context aware. Also I had to look into ctags/etags to make a nice tags file for VIM to understand the whole project (including Zend Framework).
With a tags file I was able to lookup methods and see a small preview of the parameters to the method, which was a very nice addition, but not being context aware, I had to skip and move on.
NetBeans is becoming a bigger player in the PHP community. I’ve been keeping an eye on it for quite some time, but in the beginning it didn’t feel right.
First of all, NetBeans is a great IDE. The autocomplete is spot on, very responsive and gives a nice preview of the parameters + info from PHPDoc blocks.
The downside? Well.. The biggest issue is the way new projects are handled. I can’t create a new project, and check out code from Subversion directly into that project, it simply fails every time. Every time I have to start a new project in NetBeans I spend 15-20 minutes getting my files in the right place, not good enough!
Another anoying thing with NetBeans is that it can’t handle if files are edited outside the IDE. If I create a new controller with zftool, NetBeans will screw up. When trying to commit to Subversion it can detect a new/changed file. But the IDE refuses to update the list of files.
Not being able to change files outside the IDE is not an option for me. This is the main reason I’ve been avoiding NetBeans, otherwise it seems to live up to my requirements. However, the IDE could use a bit of a clean up, sometimes it feels like the toolbars take up too much space.
Eclipse has been my editor of choise for many years. The autocomplete never fails, huge amount of plugins, nice UI and everything.
For me it has two huge downsides:
It’s slow. When working with Zend Framework, there is a huge amount of objects to index, so doing code completion on an object takes several seconds, which is very anoying.
The second thing is that it seems to be getting worse handling renaming of files. Some time ago, they added some nice refactoring support, but as a side note it fucks everything up. Try renaming a directory with multiple subdirectories and files, without having to manually move some files. On top of that, Subversive/Subclipse (I’ve tried both) fails horribly when you rename things. I usually have to copy the directory (which enables me to enter a new name), delete the old one and add the new one to Subversion. Great..?
Aaaaaand the winner is!
None of the above. The real question is which downsides you can live with. I decided that I can’t live without a good autocomplete, which makes it hard for me to find a good IDE. The perfect solution (for me!) would be the autocomplete from NetBeans, the power of Emacs/VIM and the interface from Eclipse..
For now I still use Eclipse. I’ll be checking out NetBeans 6.9 soon, the beta looks promising, so I’ll cross my fingers.
If anyone has been able to do a proper autocomplete setup with VIM/Emacs please tell me about it!
Thanks for all the great comments, I believe I have some digging to do! Over the next few weeks I’ll look into all the suggestions below, which includes:
- NetBeans 6.9 Beta
- JetBrains’s IDEA
- JetBrains’s PhpStorm
- Zend Studio for Eclipse
Last night I had a quick look at PhpStorm and I must say it looks very, very promising. I’ve also installed the latest NetBeans at the office, looking forward to seeing it in action. I’ll keep you guys updated on the progress.