IDEA versus Eclipse

IDEA has been giving me grief lately. Fed up with mysterious pauses, bugs in svn moves, and crashes even after performing cache-deletion voodoo in IDE, I’m back to trying Eclipse.

Keystroke differences and functionality differences have been the major stumbling blocks. The things I miss from IDEA:

  • Refactor > Safe delete
  • A single keystroke that does svn update for the whole project
  • smart-complete that builds anonymous inner classes with the methods stubbed out automatically (I found the secret — ctrl-space after typing “new”, the interface, then left paren)
  • smart-complete that only offers classes or fields that are semantically correct (rather than eclipse’s string-matching-based complete). This is my most frequent grief.
  • The ability to group together sets of files for committing (but I think Mylyn does this) (Switch to the SVN Repository perspective, and open the Synchronize window)
  • The ability to rollback or make changes to files while still in the commit window (again, you can surf your pending changes in the SVN Repository’s “Synchronize” window)
  • There are bugs in Refactor > Move — not all string or spring XML references get fixed properly.
  • The code formatting preferences in Eclipse are much less flexible than IDEA’s.
  • I haven’t found the keystroke yet to “go to next error/warning”.
  • Spring IDE gets confused if the XML file isn’t fairly well formed. IDEA seems to still be OK if the file is in tatters.
  • ctrl/cmd-clicking targets in ant build files don’t take you to the target definition. They take you to a nearby matching string, which may or may not be the target.

Things that I found that work better in eclipse:

  • Eclipse kicks IDEA’s booty up and down the street when it comes to performance. Eclipse startup time for my large-ish work project: 19 seconds. IDEA, opening the same project: 2 minutes, 25 seconds. That’s after an initial launch and quit, so they both should be using only cached-in-RAM files. Eclipse never pauses while typing. Ever. IDEA momentarily wedges every few seconds.
  • Projects in your workspace (IDEA calls them “modules”) can be “closed” temporarily when you aren’t actively working on them. That saves memory and recompilation time.
  • You can run automatic code-cleanup fixes on save (and only apply those fixes on the lines of code that you touched)
  • The templates support auto-imports and auto-static-imports (fancy!)
  • IDEA has this artificial partitioning of file types in the project tree based on what facets are enabled in a module — there’s no simple filesystem tree widget for me to find, say, the web.xml that lives in ../web/WEB-INF/. IDEA shoves it into a “libraries” root node. Eclipse has both a project explorer and a package explorer that don’t do this weirdness.
  • Creating new JUnit tests in Eclipse is sane and intuitive. IDEA doesn’t have a junit test plugin that worked reliably for me.

Things that are a blessing and a curse:

  • Eclipse has this weird “it’s not real until you hit Save,” whereas you never click save in IDEA. A bunch of things (incremental compilation and spring validation) only happen after Save All. But you get used to that.
  • Eclipse has very flexible window management — far exceeding IDEA’s. You can dock, stack, drag, quick-hide, pile, and generally get very confused or very satisfied (depending on your experience level) with where windows are. Is an editor on the wrong side? Drag the tab where you want it. IDEA’s editor tabs on the mac simply don’t work — after N tabs are shown, the other tabs disappear, and you can activate an editor where the tab isn’t visible or in focus. So at least Eclipse’s tabs seem to be bug free.
  • Eclipse update sites that are external to eclipse.org — I added a couple plugins that destabilized things to where I couldn’t bring any window up without an exception being raised. I ended up having to start from a new bare-metal install again, but my project settings were picked up (including the new keymaps) so that wasn’t too bad.

Updated May 7th with some of the solutions I’ve come across.

Tagged with: , , ,
Posted in Technical HOWTOs
  • Dmitry

    Good points on eclipse. Svn functionality is lacking and buggy. I think IDEA is better on that front.
    But on build.xml – I do believe control+click goes to target definition as long as you use the Ant Editor, not just XML editor. It does get confused with too many includes, does not have good undo support, and messes up indentation on copy/paste, but hey, nobody’s perfect, right? :)

    There’s “jump to test” function in Eclipse JUnit plugin but have you found something like that for TestNG?

    Also, IDEA brings up a drop-down list of implementers on an interface or method name, right by the method name. Eclipse has Control+G to find definitions but those come up in another window. Not quite as nice.

    Save or no save: I am so used to hitting Control+S every few lines that I get worried if I watch someone work in IDEA and never save. But to me it’s as natural as putting a period at the end of a sentence, so I find it comforting and not a problem.

  • http://matthew.mceachen.us matthew

    Svn functionality is lacking and buggy

    Actually, I’ve found the opposite — that IDEA has repeatable SVN bugs, and eclipse does what you ask it to. The main thing I miss is “change set” management, but I’m seeing if Mylyn and the SVN perspective’s “synchronize” window will get me there.

  • http://sujitpal.blogspot.com Sujit Pal

    >> I haven’t found the keystroke yet to “go to next error/warning”.
    C-. to next error/warning
    C-, to previous error/warning.
    (C- == Control and)

    At least thats true in Eclipse’s emacs mode. I also find Eclipse considerably cheaper, even with the $30 yearly subscription to MyEclipse. You may want to look at MyEclipse, they have pretty good support for Spring XML refactoring.

  • Jeff Johnston

    You might also want to try Netbeans! I switched from Eclipse to Netbeans around version 6.0 and I really like it. Its hard to believe how bad it used to be and how great it is now. I have also started making my own Netbeans applications and its a really nice framework to program against. Its no wonder Netbeans is on such a roll right now.