Software Development

Eclipse 3.6 vs IntelliJ IDEA 10.5: Pros and Cons

After having worked with Eclipse for over 5 years I’ve came to use IntelliJ IDEA intensively on a J2EE project in three months and took this as an opportunity to compare the two. You can’t really compare 5 years and 3 months but I still believe that it is long enough to get a pretty good overview of what a tool is like.

For the impatient:

IntelliJ is a very good tool, its killing feature for me is its excellent support for other languages such as Groovy (e.g. for unit tests) and Clojure. Many details are more worked-out and with a higher usability then in Eclipse, f.ex. search & replace with match highlighting and replacement preview. Its support for navigability and refactoring across multiple languages (Java, JSP, JSF, HQL, Spring config in my case) is also an absolutely great feature for productivity. And of course I have to add it credits for being a Czech product [1] (interestingly enough, NetBeans also comes from the Czech Republic [2]; it’s a pity Eclipse hasn’t this link too.

My main issue with IntelliJ is its performance. First, running tests is slow because IntelliJ only does (re)compile the test/source when you hit the run button as opposed to Eclipse’ incremental compilation. And that makes TDD very painful. (I tried to use the old Eclipse Mode plugin but it has problems with IntelliJ 9/10.) Second, sometimes the UI freezes* and you have to wait seconds or tens of seconds for it to respond again (even after disabling most plugins and some analysis). It doesn’t happen too often but often enough to be noticed, to be annoying, and to interrupt the development flow.

(*) Update: UI freezes may be a specific issue of Mac 64b 1.6 JDK

So I guess I’ll use either Eclipse or IntelliJ with respect to the needs of the project at hand and hope for IntelliJ to resolve its performance issues (as NetBeans did).

The Software Compared

  • Eclipse 3.6 – I’ve worked with Eclipse since 3.0 or may be even before on many commercial projects
  • IntelliJ IDEA Ultimate (the commercial, full-featured edition; II community is good enough unless you need special support for frameworks like JavaEE, Spring, and Hibernate – see the editions comparison)

What’s Cool in IntelliJ IDEA

The things I’ve stumbled upon and considered them noteworthy (there are certainly more of such goodies):

  • Great support for Groovy and Clojure (and others). I’ve used Groovy to write unit tests for my Java project and it worked pretty well (only click + Alt+Enter on a non-existing method to create it didn’t work unless the target class was a nested (static) class in the test itself)
  • Out-of-the-box support for Spring*, namely you can click a bean class name in the applicationContext.xml to jump to it, deprecated classes are struck out, bean definitions are validated against available constructors and setters
  • Refactoring
  • Move can move more members/methods at once
  • Move method is aware of the current class’ field of the target type so it is able to automatically insert fieldOfTargetType.movedMethod() – st- I miss a lot in Eclipse
  • Rename takes care also of JSF EL expressions in JSPs and other non-Java references (I suppose it is more clever than just a simple text search & replace)
  • Completion proposals are displayed as you type (without pressing a hotkey – I love that) AND they include types that haven’t been imported yet (@BeforeClass in a test…)
  • (Auto)Completion proposals over multiple languages
  • CSS classes in JSPs (and in CSS/style it proposes e.g. color names)
  • Click-through in JSF EL expressions (well, at least sometimes)
  • Usage search can find also method usages in JSPs, Spring config etc.
  • Debugging
  • The Variables window automatically shows not only the local variables but also expressions based on them that are used in the code such as “array_variable.length”- a good time saver
  • JavaDoc: Closing tag completion – I’ve always missed that so much in Eclipse!
  • When you generate a foreach loop (“itco” + tab) and change the source collection then it updates the element type automatically (in “for (Type t: sourceColl)”)
  • Really helpful RegExp integration in find & replace in file – when typing, it shows both the first matched expression and what it will be replaced with
  • General: Good at guessing resonable names for variables, …
  • Possibility to define a module for a subdirectory of the main module => you may have a project using Java 1.4 with tests in Java 5+. Works great with Maven multi-module projects too.
  • The Project view displays directly Java types so you can distinguish a class from an interface at the first glance (Eclipse shows a file icon and you need to expand it first)
  • The Java file structure view can show a “property” instead of a getter and a setter, making it shortet and easier to find what’s really important

(*) The Ultimate edition only (likely)

I’d recommend reading also the responses to the StackOverflow question Things possible in IntelliJ that aren’t possible in Eclipse? – among others they mention click-through anything, autocomplete taking into account more of the context (e.g. the name of the variable), the rename method refactoring updating also JSPs, Spring config, etc..

In general I’d say that IntelliJ has strong focus on usability and productivity, tries to understand what developers usually do and need and helps them with that and is pretty good at it. The authors claim it to be “The Most Intelligent Java IDE” and I think they do not exaggerate (or at least not too much).

Not So Cool

(In no particular order.)

  • Eclipse only needs two hotkeys: Completion (^space) for class/property/templates/surround-with and Quick Fix (^1 – the most powerful tool in E.) for fixes such as imports, refactorings etc. In II you’ve several hotkeys for completion, one for live templates, one for fixes (intentions) … – I’ve never managed to remember them all and to decide which one I should use in a particular situation
  • No JavaDoc popup on mouse over (need ^J)
  • The Live Template editor sucks, at least under Mac (can’t type end-of-line, a curly bracket on Norwegian keyboard with Alt+Shift+8, backspace, …). Fortunately you can select a code in an editor and Tools | Save as Live Template (though you should likely un-indent it first)
  • No favorite static imports – for the first static method of a particular class I have to: 1) write the start of the method name; 2) press Ctrl+Alt+Space (Class name completion, don’t ask me why this); 3) select the desired method such as CoreMatchers.allOf and press Alt+Enter as suggested in the pop-up’s “status bar” -> select Import statically. Since that on, all the static methods of the class will appear in the normal Ctrl+Space completion list (that’s nice, though). In Eclipse I can add my belowed JUnit/Hamcrest/Mockito friends to favorite imports and have them always available.
  • Slowness
    Slow testing – changed files are compiled just before a test is run while in Eclipse they have been compiled as soon as they were saved
    Sometimes II freezes for seconds/10s of seconds :'(
    Update: UI freezes may be a specific issue of Mac 64b 1.6 JDK
    Running analysis is SLOW (Checkstyle, …) and can kill your IDE (and you too if you’re of a weaker heart)
  • The UI is little buggy, at least on Mac – dialogs not hidden when you click on another menu – not a big issue but annoying anyway
  • Running webapp on Tomcat works great for some colleagues but not all – useless logging without any details, the server doesn’t start, no hints for how to solve, the Server -> Output window contains confusing “Disconnected from server”, Tomcat Log window contains only INFO logs (where are my debug logs?!), the file logs/catalina.out doesn’t exist anymore, Tomcat failure visible in browser yet nothing in the logs …
  • JavaDoc – ‘#method’ + ^space in Eclipse generates {@link #method} automatically, not so in II; even worse, class lookup doesn’t work at all in II w/ot typing a @link first. I’ve found a workaround via a live template but I have to type its name and invoke it manually anyway.
  • I miss Eclipse’ auto-dissapearing views (just click anywhere in the editor and they’ll disappear – though in II you can use Shift+Esc and if you un-pin a view then clicking in&out of it will hide it) and the ability to maximize any view with double-click
  • The number of plugins for IntelliJ is smaller than for Eclipse though all the main projects likely target it too

I could perhaps live with the small annoyances (or may be learn the proper way to do what I’m trying to achieve?) but the performance issues are hard to accept.

Useful Resources

Reference: Comparison of Eclipse 3.6 and IntelliJ IDEA 10.5: Pros and Cons from our JCG partner Jakub Holy at the Holy Java blog.

Related Articles :

Jakub Holy

Jakub is an experienced Java[EE] developer working for a lean & agile consultancy in Norway. He is interested in code quality, developer productivity, testing, and in how to make projects succeed.
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
5 years ago

IDEA is not a Czech product. JetBrains founded in 2000 by three Russian programmers, produces software development tools. Offices are not only in Prague (this is just financial & sales center), but also in St. Petersburg, Munich, Novosibirsk, Boston and Moscow. The main development is made in Russia and some tools developed in Munich & Boston.

Back to top button