Lately I have read a lot of IDE discussions about IntelliJ IDEA. I've only ever heard good things about it and was curious how it compares to NetBeans 6.0, which is nearing beta. The main plus points that I hear over and over about IDEA are its code editor, refactoring capabilities, and performance. Everyone knows that IDEA is way ahead of other IDEs in refactoring so I didn't look at it. Instead, I compared features that I personally find useful in NetBeans, and also some areas of NetBeans that could use improvement. I downloaded IntelliJ IDEA 7.0 milestone 1 (a dev build) and NetBeans 6.0 milestone 10. I'm running these on Ubuntu Linux 7.04 with JDK 1.6.0. This was the first time I have ever tried IDEA.
The first thing that shocked me was how fast IDEA started up and was ready for use. When I tried again several days later I was not as impressed because it seemed to take a lot longer. Maybe the first time I tried IDEA the JVM was already loaded, but not the second time? Also the second time it was examining project files that I had created the first time I tried IDEA. IDEA takes 15 seconds to load and be usable, and NetBeans 6.0 takes 30 seconds. I do this only once per day so load time isn't a big deal for me.
Next I created a new web project in IDEA. I really did not like the (seemingly) 15 screen wizard asking me all kinds of questions such as which directory to put source files in, which for compiled classes, which for resource files, etc... I had to do a lot of reading and decision making. I much prefer NetBeans 6.0's new project wizards. It asks more than one question per screen, and makes a lot of default decisions for me. I like the consistency of these default decisions (such as paths). However, I think it is powerful that IDEA is flexible enough to accommodate any directory structure. This can be useful when working with code written in other IDEs or text editors. NetBeans has a “New Project With Existing Sources” project type. I have not tried it and don't know how flexible it is. IDEA has “Import from Eclipse...”, “Import from Jbuilder...”. The NetBeans 6 help file talks about using the update center to add the Eclipse and Jbuilder project import functionality. Update Center has been renamed to Plugins Manager, and I don't see these plugins. Maybe they will be coming in the future?
Once I had a web project created in IDEA I double clicked on the web.xml deployment descriptor. What I saw next shocked me. I saw... raw XML!!!! I also see raw XML for ejb-jar.xml, sun-web.xml, persistence.xml, and probably other deployment descriptors. I couldn't believe the IDE of IDEs doesn't have visual deployment descriptor editors like NetBeans, Jdeveloper, WebSphere Studio and other IDEs. Some developers may argue that editing these deployment descriptors is easy, especially with the code completion. Well, until you have used visual deployment descriptor editors you have no IDEA (pun intended :). Why are there visual editors for JSF and Struts navigation cases, but not other deployment descriptors?
The next thing I wanted to try was the infamous code editor. Using the web.xml file, I started to type the name of some elements that I know it uses. I was very impressed by the instantaneous responsiveness of the code completion. I'm used to a short delay, maybe half a second or so before code completion opens. In IDEA, it seemed like it came up as my fingers were still pressing the CTRL-SPACE combination. Next I created a Java source file and tried some more code completion. Again I was blown away with how fast it was. I found that anything I pressed or clicked in IDEA had an instantaneous response. Very nice. I used to think IDEA users were over exaggerating when saying that Eclipse and NetBeans are sooooo slow. If I got used to this kind of performance, I would probably say the same about the other IDEs. However, I don't think you can say NetBeans 6 is slow anymore.
One of the major new features of NetBeans 6 is a complete re-write of the code editor. The new editor uses the JDK 6.0 compiler APIs to access the Abstract Syntax Tree which is extremely fast, and provides every minute detail about everything to the code editor.
The Java compiler (as do most compilers) parses source code into an intermediary representation, which is structured as a tree. Each node in this data structure (called an Abstract Syntax Tree) represents a code element: a class, method, statement, block, identifier, operator, literal, etc. Though code processing tools usually manipulate programs as ASTs, many use a simple parser that produces only a basic tree. The “full” AST produced by a complete compiler like javac, which is capable of semantic analysis and code generation, will contain very detailed and reliable information about each node. For example, the node for an identifier holds not only its name but also its type and its ”definite assignment” status (whether the identifier is guaranteed to be initialized at a given point); it can even hold its statically-calculated value (when applicable). Tools that work on top of a full AST are much more powerful and reliable. The difference won’t be noticeable for a simple selection feature, but it may be very significant for more sophisticated functionality like refactorings.
When I try code completion in NetBeans 6.0, I am equally impressed. I've read some IDEA users say that it is still slow but I have not experienced that myself. I can see a significant improvement over NetBeans 5.5's code editor.
Earlier I said that I wasn't going to be talking about refactorings. I lied. I want to talk about NetBeans 6.0's new refactoring engine called Jackpot. It is a language-independent refactoring API that will allow implementing refactorings for code other than common .java sources (e.g., XML or JSF files). The new API also allows Java refactorings to precisely update dependent non-Java elements. This should make the current refactorings safer and easier to use. Jackpot is actually a comprehensive framework for general code understanding and manipulation. You can use it as a replacement or foundation for several kinds of features: refactoring support, advanced searching and browsing, quality inspection, macro-like automation of complex editing tasks, and more.
Because Jackpot – like the new editor – relies on javac’s source analysis engine, it’s able to fully attribute all types in the processed code. This includes the most complex cases, like inferred generic types. Other code analysis tools often resort to heuristics that approximate types but might fail to calculate types for some expressions.
Jackpot also has a query language used to write the refactorings. The refactorings you find in NetBeans 6 are actually Jackpot scripts. I believe that one day Sun or the community will create Jackpot scripts that will match IDEA's refactoring capabilities.
Now back to IDEA. Here are some other features I liked:
- When creating a new JSF web project I could choose between Sun's reference implementation or Apache MyFaces. I would usually choose Sun's RI but when working with some app servers, you have to use MyFaces. I think some of the JSF component libraries also rely on MyFaces.
- Built in support for Spring and Hibernate. I'll bet NetBeans doesn't have these built in by default because Sun is pushing Java EE. There are a couple of plugins for Spring and Hibernate, though I'm not sure how good they are. I've never seen anyone use them or talk about using them.
- IDEA supports the following app servers: Tomcat, Geronimo, WebLogic, WebSphere, Jboss, Glassfish/Sun App Server. NetBeans supports those too, with the exception of Geronimo and WebSphere.
- IDEA has support for exploded deployments. I don't think NetBeans supports this.
- IDEA has many Analysis features built in such as code metrics, test coverage, the equivalent of checkstyle and findbugs (I think), etc... NetBeans has some plugins to do these, but I doubt the work in NetBeans 6 and they are not built-in.
- This one is a negative point. To get a profiler for IDEA you need to spend another $500+. NetBeans comes with a powerful and performant profiler built in.
I've read complaints from developers who say their 10,000 – 20,000 file projects make NetBeans extremely slow. I don't know if they were using NetBeans 5.5 or 6.0 but I do know that performance is a major priority in 6.0. There is a performance tiger team that moves from module to module to speed up problem areas. Milestone 10 was the last milestone in NetBeans 6. It is now feature complete. The work from now until final release in November 2007 will be bug fixes and performance improvements.
I admit that I did not do an exhaustive review of IDEA. I only scratched the surface but did answer the burning questions I had about it. To really experience IDEA I need to spend a few weeks full time with it, take the time to learn the keyboard shortcuts, and refactoring features. Those who love IDEA say that once you make the effort to learn it, you will never look back at any other IDE. I think I would be happy working with IDEA if I had to. I haven't worked on mega projects in Java yet so have not encountered limitations in NetBeans. NetBeans has all of the features I need and I don't find it slow. I won't be switching -- at least not until I can give NetBeans 6.0 final release a chance.
Working from his home office in Toronto,
Ryan de Laplante can be found developing software in
Java by day, and obsessing with technology by night.
Ryan has been designing and writing software for
IJW since 1998 and is very passionate about his work.






Great article!!!
Speed is key, and I am still dissapointed with NetBeans speed and memory usage. But truth be told, I am doing fine with NetBeans these days. Nice work!!!
I would be interested in seeing the same kind of comparison with MyEclipse. I wonder if you plan to do the same type of comparison with MyEclipse?
I would have liked to see more coverage of page editing features. Is there a WYSIWYG editor? Is there split screen support for code and design? Is there round tripping? I am not a fan of VWP for anything other than throwing together a prototype quick. VWP redefines (IMHO) JSF to be something very constrained to someone elses set of design rules and coding conventions. In any case, I would be interested in what you thought of their web page editor(s).
Also saying something for what kinds of support for Web Services IDEA provides would be nice. AXIS2, CFX, Glassfish Metro? And how web services and web service clients are created and consumed would be nice. Is all Web Services code hidden (under build/generated directories) as it is with Netbeans? Or some other convention. Is creating client code as simple as right clicking and selecting as it is with Netbeans?
ITVGuy2000
Posted by ITVGuy2000 on July 16, 2007 at 03:44 AM EDT #
Thanks :) I will either update this existing entry or create a second one with some or all of your requests. I too am curious about these.
Posted by Ryan de Laplante on July 16, 2007 at 07:03 AM EDT #
How is the IDEA coded editor "infamous"?
You say that you like how NetBeans has nice defaults when creating a new project. IDEA also has defaults. You can usually click new project, then type in a name, and hit next a handful of times and everything is done.
I am surprised you hear that IDEA is fast. Most of the complaints I hear about IDEA is that its slow. Maybe NetBeans and Eclipse are _really_ slow.
Posted by Charlie Hayes on July 16, 2007 at 06:15 PM EDT #
When I say "infamous", I mean legendary, known for how good it is. I have read a lot of debates about NetBeans vs Eclipse, IDEA vs Eclipse, etc... IDEA fans who get involved seem to always talk about how great their code editor is. They say that it has a lot more refactorings, performs faster, etc. When I did my brief evaluation I didn't bother to test the code editor much because everyone seems to be in agreement about how great it is.
When creating a new project I did see the pre-filled in values, and did press next through to the end while reading each of the screens. I wrote my personal opinion, though something like that is not enough to stop me from using IDEA. What I like about IDEA is that out of the box it comes with almost everything you need. I like NetBeans for the same reason.
I am surprised to read your comment about other people saying IDEA is slow. I haven't read any comments where Eclipse or NetBeans users claim that their IDE is faster than IDEA. I have read many comments from IDEA users complaining that NetBeans and Eclipse are slow. Oh well, everyone has their own opinions. Thanks for the comment.
Posted by Ryan de Laplante on July 16, 2007 at 07:20 PM EDT #
IDEA is, to borrow an acronym from Guy Kawasaki, a DICEE product. I haven't used NetBeans, but I have used both Visual Studio and Eclipse extensively. Visual Studio without Resharper (also by JetBrains', the guys behind IDEA) is a complete write-off. Eclipse feels clunky - but that's my opinion and is subjective.
But IDEA rocks because they believe in details. And they indulge the developer. Nothing is too good, not usability feature too trivial. I will give NetBeans a shot one of these days, but the amount of time and effort IDEA has saved me these last two years is not something I will forget easily.
Posted by Sidu on July 16, 2007 at 10:06 PM EDT #
To edit the deployment descriptors in forms instead of plain XML in IDEA switch to JavaEE:Structure in Project View (Alt-1), open the desired facet and click on the module root (not on the file itself).
Posted by Baruch on July 17, 2007 at 04:18 AM EDT #
Hello Ryan,
curiously, I'm making a similar comparison for personal use: Idea 7M1 vs Netbeans 6 M10 vs Eclipse 3.3 on linux Ubuntu 7.04 and Java 6!
The general feeling (I didn't use them extensively) is that Idea and Netbeans are both quite fast and stable, Eclipse works very slow and crashes without prior notice (but this may be my fault, who knows, but for now I let it apart).
The refactorings work great on Idea but not so good in Netbeans... maybe it will get better in the final version.
I think I will wait for the final versions of both and then decide if Idea is worth 250$ more for my needs.
Nice article!
Greetings, Riccardo
Posted by Riccardo on July 17, 2007 at 05:45 AM EDT #
Don't know if you tested the new Eclipse 3.3 which was released few time ago, it seems to be a real nice improvement of Eclipse. Specially if you pick the WTP2 package, which has an all inclusive zip file bundling Eclipse 3.3, I've had so far no problem with it whatsoever.
Coming back to the topic, I've noticed that IDEA is indeed very fast, but other editors can be as fast if you don't rely extensively in code completion : on my own, i usually type 3 or 4 caracters of the next "word" i'm about to auto-complete, and usually it's completed directly or the menu with auto-completion candidates is much faster to be shown, because there is much less elements.
As well, I find it a good point that IDEA comes with support for Hibernate and Spring. Netbeans focusing on JavaEE technologies exclusively is not really convincing if you use other frameworks.
I also like the Code Analysis feature of IDEA, which is quite complete and gives good advices, and often proposes good quick fix options.
In the end, IDEA seems like a good product for it's price, for less fortunate people, you can give a try to MyEclipse which is a bundle of Eclipse with various pluging to work with different frameworks like Hibernate and Spring, and concerning Netbeans 6, it's for the moment not complete and therefore I wouldn't be able to give a good advice for it, but I know for sure one domain where netbeans excels, it's with it's GUI designe Matisse which I find yet today pretty impressive.
Posted by KiLVaiDeN on July 17, 2007 at 05:59 AM EDT #
One of the most basic features missing in netbeans is an easy way to open up a source file.. In Idea Ctrl+N just opens up a text box with autocomplete for file names. There is absolutely no equivalent in Netbeans...
Posted by Aniket on July 17, 2007 at 06:00 AM EDT #
By the way idea also has GUI editors for deployment descriptors: they are a little bit hard to find, indeed (you must use the j2ee view, I think). They sure could benefit from a "multiple-perspective" editor like the ones they're using for spring configuration (allowing you to switch from the xml view to the graphical one with tabs).
Posted by Davide Baroncelli on July 17, 2007 at 07:51 AM EDT #
I don't think any of the "Jackpot" feature will be delivered in 6.0. It's not in M10, and that is the feature freeze release.
The other point is, Jackpot is pretty much a (PMD + automatic code change) type of thing. It's no replacement of the on-the-spot refactoring that NetBeans is way behind of IntelliJ.
Posted by wqt on July 18, 2007 at 10:00 AM EDT #
A couple of features I miss in Netbeans - maybe these are there already:
1. Ability to split an editor window by dragging on the corner of the scrollbar so that I can see two parts of the same file - this feature is present in Visual Studio.
2. A way to pin a find text field on the toolbar, so that find is easier (again borrowing from Visual studio).
3. An easier way to debug servlets in Tomcat. In Eclipse, using the Sysdeo Tomcat plugin, I can start Tomcat and start debugging immediately. In Netbeans, I have to start Tomcat, then attach the debugger. Maybe there is an easier way.
Posted by Roshan Shrestha on July 18, 2007 at 12:00 PM EDT #
I started a thread on the NetBeans users mailing list asking about Jackpot in NB6. Tom Ball from Sun responded:
----
It depends on how you define Jackpot. When we were a research group at Sun Labs, Jackpot was a separate application prototype, with the transformation engine, rules language support, and UI all in one jar. After the Jackpot project moved to the NetBeans group to be productized, it was split into three modules: engine, rules, and UI. In 6.0, the engine moved into the new core Java Source module (disappearing as a separate module), and the rules and UI modules simplified to use Java Source. The current source of the Jackpot modules is much less interesting than before, because the heart of the technology has been integrated into the IDE.
So while the Jackpot modules aren't in NB6, most of the Jackpot technology is part of NB6 in the Java Source module -- the new Java editor and refactorings use it, for example. Today the UI and rule language modules are distributed via the development (alpha) update center, but they are being cleaned up to move to the beta update for the next milestone and final release. If there is enough interest, they could move into the core IDE in the future.
----
> When I use refactoring in NetBeans 6 (such as rename a method or class), is the built-in Jackpot engine doing the work?
Basically, but the refactorings also involve a lot of engineering analysis and development -- check out the refactoring/java module to see the distinction.
----
> Is it true that if someone spent the time, they could create rules that will make NetBeans 6 match IntelliJ IDEA's refactoring capabilities?
Yes, but that's assuming that IntelliJ IDEA's engineers stop enhancing their product, which they aren't! Isn't competition wonderful? :-)
FYI, the rules language is only one way that the Jackpot engine can be used, as it has a Java API for writing refactorings that can't be done by the rules language. Rules are focused (today) on refactoring expressions and statements, while the API can change anything.
----
Posted by Ryan de Laplante on July 18, 2007 at 01:15 PM EDT #
Yes you can do split editors in NetBeans. Right click the tab of the open code window, and select "Clone Document". You can then drag/drop the cloned editor window to the left, right, top or bottom to split horizontally or vertically. You can even have multiple split windows at the same time.
About debugging Tomcat.. I have not done debugging with it from NetBeans but with Sun App Server I "Debug Project" instead of "Run Project". It's a different icon on the toolbar, and a different context menu item when you right click the project.
About pinning text... I've never seen this feature before and don't know what it is.
Posted by Ryan de Laplante on July 18, 2007 at 01:18 PM EDT #
More from Tom Ball about Jackpot:
To be honest, I'm disappointed that the Jackpot UI and rules support didn't make the 6.0 "cut". However, as a Java developer I'm glad that there has been so much focus on improving the Java editor, even if it was at my project's expense. I'm especially happy with how sophisticated the Java editor tips have become -- underneath each little light bulb is a complete Jackpot-enabled refactoring. We have had discussions regarding supporting independent tips created using Jackpot rule files, but no one has had the cycles to do that yet.
So the compromise is that the Jackpot UI and rules support goes beta with the next 6.0 milestone, so it will be installable without having to add a new update center.
P.S. Much as I like PMD, the new Java model in 6.0 provides the semantic information that a parse tree can't provide, which (in theory) means that more sophisticated queries can be created with the 6.0 model.
Posted by Ryan de Laplante on July 18, 2007 at 10:28 PM EDT #