My top 8 reasons to use IDEA over Eclipse

Monday, August 17th, 2009 | Uncategorized

I use IntelliJ IDEA as my primary IDE, although I’ve used Eclipse on and off in the past. The last time I switched back to Eclipse was to maintain the Eclipse plugin for Testability Explorer, and I was reminded of some things that I really missed. Here are my killer features:

Diff editor is full-featured

You’ve finished making some changes to a codebase you care about, so before you commit, you take care to look through the delta you’re about to commit and make sure it includes the right stuff, and to double-check your work. Often, I notice little things while I’m doing this – like missing documentation, some statements that could be refactored to a shorter form, or such. So, I begin editing the right side of the diff, and I need to have my real code editor there, so I can get completion in my {@link} javadocs, code completion, and so on.

I’ve seen people using Eclipse who get to this step and have to go back to the normal IDE window and then go find the file they were reading in the diff view. Too much context switching for me.

Completion shows compatible types

You start coding:

Widget w = new |

At the cursor, you’d like to get a completion list that shows the Widget class and any subtypes. This is especially important for some APIs that you don’t know well or don’t use often.

java.io.Writer w = new |

Man, I love getting suggestions like FileWriter there. I think Eclipse can only attempt to sort the list of completions in order of some heuristic of how likely you are to pick it.

Apple-arrow mapped to line home/end

It’s a minor thing on the face of it: on Mac, the home and end keys take you to the beginning and end of the document. Since Eclipse is on SWT, it’s not surprising that you get the native Mac behavior. In IDEA, maybe because it’s Swing, I get beginning and end of line instead. Whenever I use Eclipse, this majorly screws me up, because I forget to re-map my brain and lose my place in my editor.

I’ve tried to fix this in the OS, but it was too painful.

Understands prod/test code

I often feel like IDEA is made for people who write code, and Eclipse is made for people to write Eclipse plugins. This is an example of IDEA understanding how coding works – you always have a prod folder and a test folder. Instead of labelling these folders as just Source folders as in Eclipse, you tell IDEA whether they contain prod or test resources (or get it from an external model like a Maven POM). Now, when you do a search, you can search just prod code or just test code. When you make a new Test with the testdox plugin, it knows which source folder the new class belongs in.

Save on blur

We always work from a version control system. So, in my mind, the “buffer” I’m editing is my working copy. If I want to revert my changes, I use the VCS to do it. So, I hate the notion of “saving.” I don’t see how it’s ever useful to have different contents in the in-memory editor than you have on the disk. When I make changes to a file, I want the changes to get flushed out to disk. IDEA can do it when the IDE loses focus, which is a nice time. That way, my shell always sees what I typed. When I use Eclipse, I run something and it seems like my changes didn’t take effect. Then I realize there’s an editor tab with a star on it. The star makes me really frustrated, because it’s just the IDE telling me that it *knows* my disk has stale content, and asking me to do the busy work for it.

Diff annotations in gutter

Since we’re always coding against version control, our job is often to craft incremental changes to the codebase. I want to see that delta at all times, especially in the editor. That delta is my actual work product and it’s annoying to have to invoke another view to see what I’ve done so far, and revert changes or copy the previous content.

I’ve noticed that I’m more exploratory in my coding with this feature – if I don’t like the path I’m going down, it’s trivial to remove the last few changes and start a different change. I think there’s an Eclipse plugin for this, I guess that would work if it’s truly universal on all editor views and consistent with the VCS plugin, but I really don’t install many plugins.

SVN support built-in

It kills me to watch Eclipse users install a Subversion client plugin. It’s not easy to do, since you have to choose between JNI and pure Java, and the JNI version seems to have problems locating the native libraries in my experience. Maybe the install has gotten better, but still, this is another example where Eclipse should really support what I do out of the box. I think Subversion is popular enough that I should be able to check out a project with a freshly installed IDE.

Understands multi-changelists

I have more than one change happening in the same working copy a lot of the time. I like moving files into different lists, so when it’s time to commit some work, I have the right set of changes already grouped together. In Eclipse, I would usually toggle the checkboxes on the commit dialog to choose the files to include in the commit, and it was really hard to remember which classes belonged in the change. And I made a lot of mistakes.

Java – final variable to constructor parameter

The quickest way to type code is not to type, instead, let the IDE fix things as you go. Setting up the dependencies of a class is a common place where there’s a lot of typing, at least in a language with no properties like Java. I like to create my fields first, and if I make them final, IDEA will offer to add them as constructor parameters. Eclipse doesn’t – you must go the other way around, creating the constructor and adding parameters, then using the auto-fixer to create the fields.

2 Comments to My top 8 reasons to use IDEA over Eclipse

Brad Green
September 18, 2009

My top reason for using vi: Nobody tries to compare their IDE to mine. :)

Kostas
February 3, 2010

Diff editor is full-featured > Compare editor has enough features for me, i always do “last minute” changes, there.

Save on blur > I personally like it that i save on demand. For example when i leave from work, i leave the PC unlocked and everything. The cleaning lady comes in at some point to do their work and she ‘ll occasionally hit some buttons on the keyboard by mistake. But she won’t hit Ctrl+S by mistake.
Also, something more important, is that eclipse will start compiling only once you saved the file. If i want to do a lot of changes on a class and i have a pretty good idea on what i want to do beforehand, i start writing very fast thus producing a lot of mistype errors. But i don’t want eclipse to start coloring my screen red at that point and start going downhill in performance cause of the amounts of errors. When i have finished writing my code, i ‘ll save and then review all errors.

SVN support built-in > Well i think Eclipse will be there soon with Subversive. But it’s not that big deal as you make it sound anyway.

Completion shows compatible types -> Are you sure about that? I just installed a brand new version of the community edition of IntelliJ (mostly to see this feature) and i got this:

import java.awt.*;
[...]
Component x = new {that’s where i press Ctrl-Space}

and that’s what’s inside the popup menu:

java.lang.AbstractMethodError
java.awt.ActiveEvent
java.awt.Adjustable
java.awt.AlphaComposite
[...]

so, not only the 4 first suggestions, aren’t a jawa.awt.Component, but two of them (ActiveEvent, Adjustable) are not even concrete classes.

Leave a comment

About Me

I'm Alex Eagle. I live in Sunnyvale, CA and I'm a code monkey.

eag...@captcha.me
LinkedIn.com/in/AlexEagle
Twitter.com/jakeherringbone

Add to Google Reader or Homepage

 Subscribe in a reader

Tweets

  • @LaChilangringa thank you, he will be called Walter and might like trains or frogs. You were at the rally? What did your sign say? in reply to LaChilangringa 2010-11-06
  • It says I'm not eligible to get a payout in the Buzz settlement. I'll have to settle for juggling with the Buzz developers. :) 2010-11-03
  • It's Movember and you can sponsor my mustache. http://goo.gl/Z1O4 I miss the beard; It's very drafty on my face today. 2010-11-02
  • Can 4 guys make themselves look enough like Mount Rushmore to fool Google Goggles image search? Love the demo slam. http://demoslam.com 2010-10-20
  • Saw Dalai Lama on Thurs, running last 6mi of SF women's marathon with Peggy today. Too many crazy crowds this week! 2010-10-17
  • Attn: people of the future. We wanted to avoid all that litter! It was our 2nd priority, right after annoying noises. http://bit.ly/cJzkGT 2010-10-09
  • Headed to Hardly Strictly bluegrass in GG park. Elvis Costello free! 2010-10-03
  • I vote that @TCooganPlants is having a rough week and deserves nachos. Who's with me? 2010-09-29
  • More updates...

Powered by Twitter Tools