Java News from Tuesday, August 12, 2008

Jetbrains has posted milestone 1 of IntelliJ IDEA 8.0 (Diana). New features in 8.0 include:

After my last couple of less-than-complimentary mentions of IDEA, the friendly folks over in St. Petersburg asked me to elaborate on just what I found lacking, and why I preferred Eclipse. Here's my somewhat edited response.

I use IDEA on Linux almost exclusively, and this is not about IDEA being Mac native. There are usability bugs in this product that transcend platforms. The keyboard shortcuts are actually a bad example, because there's no fundamental reason they have to be what they are. 25 years ago the industry could have settled on different shortcuts than they did, and different platforms could have made different choices. However there is now a pretty consistent set, and one deviates from it at one's peril. Sadly IDDEA so deviates.

To fix this, start by making Ctrl-W to close a window, not Ctrl-F4; and then add Ctrl-G to Find Again and Ctrl-L to Go to Line. (Command-W, Command-G, and Command-L on the Mac of course.) I suspect there are others that need to be fixed too.

Yes, this means you're going to have to break the non-standard, incorrect bindings IDEA's already been using for Ctrl-G (and possibly the other two) for years now.

There are much more critical and harder to fix problems in IDEA's design than this. However the keyboard shortcuts are so easy to get right, that correct keyboard shortcuts are a very good proxy for whether a product has paid any attention to usability whatsoever.

Regarding method level navigation within a class, I'll check out the toolbar button you suggest, but why would there even be a toolbar button or a preference for this? That's needless clutter. Just turn the damn thing on by default and ditch the button.

In general toolbars contain opaque, meaningless icons. Neither Idea nor Eclipse is an exception here. There are some well-done toolbars (a few buttons in web browsers, most paint programs) but IDE operations don't lend themselves to visual representations. What could possibly be an icon for "Compare with latest in repository" for example? or even "Compile"? Well-named menu items are the way to go.

In any case, I did try it, and while useful you method-level navigation is simply not as good as what Eclipse has. The IntelliJ version is an extra pane with yet another confusing toolbar. In Eclipse, I just click on the little triangle next to the class name and all the members drop down. It's like browsing another folder in Windows Explorer. It's a standard metaphor, and very intuitive and easy to use. I can have several classes open at once if it helps me. The IntelliJ version just isn't as fluid I'm afraid.

You also asked me to name specific instances where Eclipse's refactoring, code completion, editing and browsing facilities are surpass those of IntelliJ IDEA. That the Context menu in Eclipse does not require me to remember Ctrl-B to jump to a declaration is the most obvious. Also Eclipse's context menu is more predictable. IntelliJ's seems to add and remove menu items so no one item stays where I expect to find it.

The References and Declarations context submenus in Eclipse are a major help. There's probably a way to do this in Idea but I've never found it. In general, the context and menubar menus in Eclipse just give me more of the options I need. Another example: adding a directory to the Build Path in Package Explorer.

The only really tricky point to explain is that Eclipse doesn't keep popping up suggestion boxes/tooltips that get in my way and keep me from editing. I'm not sure I can quite articulate the differences between IntelliJ tooltips and Eclipse's. It may have to do with the difference between Swing and SWT, but the fact is Eclipse's tooltips don't interfere with my workflow and IDEA's do. :-(

In general, focus seems to be a major problem in IDEA. When building a project. IDEA constantly steals focus from any other window I'm in (though that one might be our build plug-in's fault, not yours). However consider the Find text box. Half the time when I type in it I'm searching for a term and half the time I'm navigating through a list of previous search terms, and I have no idea which will happen when. There's probably rhyme or reason to it, but none that's apparent to me. If I try to use a keyboard shortcut to select a menu item while the focus is on the find box, it more than likely doesn't work at all.

Speaking of find, something I haven't mentioned is the Find and Replace dialog. I much prefer Eclipse or BBedit's, even when searching in a single file.

Thinking about it, IDEA's major problems really seem to come down to two issues:

  1. Focus problems
  2. Menu layouts and organization

(Code completion and refactoring aren't worse in IDEA than Eclipse, but they aren't better either. There is one minor problem in IDEA that Eclipse doesn't have with code completion: IDEA seems to double escape double quotes in my strings and insert extra double quotes where they aren't needed or wanted. I don't usually want double quotes auto-completed, and Idea doesn't seem able to match my expectations when pasting one string into another.) But otherwise code completion/refactoring is pretty much par between the two products.

With regard to menus, it's just never obvious where anything is nor are related items grouped together much of the time. For instance, I still couldn't tell you how to Open the Perforce console to move files between change lists in IDEA. I know I've done this, but I have to hunt for it every single time, and it's always a crap shoot. In Eclipse it's obvious: Window/Show View. In IntelliJ I have never found a context or other menu item to add a JavaDoc comment. In Eclipse, it's not obvious (the menu item is poorly named) but I did find it. There are lots of things like this that are probably somewhere in IDEA if I knew where to look, but the menus are too poorly organized for anyone to ever figure this out.

When someone is watching over my shoulder as I use IDEA, they're often asking, "How'd you do that?" because the only way to make things happen is obscure keyboard shortcuts like Ctrl-B that they usually didn't find themselves. When I'm watching someone else I have the same experience because they've found a few different obscure shortcuts than the ones I know. I never have that experience with Eclipse.

IDEA is like magic, and that's not a compliment. UI's should not hide how they're operated. Everything should be open and above board, not hidden by magic prestidigitation and misdirection. The more clear it is to an observer how the trick is done, the better. You shouldn't need years of practice in front of a mirror to use a code editor fluently. Lord knows Eclipse's UI is far from perfect, but I'm afraid IDEA's is much further from perfect.

If you became accustomed to IntelliJ some years ago when Eclipse was lacking, do yourself a favor and check out Eclipse for a week or two. Eclipse is certainly far from perfect, but I do think it has completely leap-frogged IDEA in general usability. If you last tried Eclipse back in the days of 2.0, or, worse yet, 1.0, I think you'll be pleasantly surprised at how far it's come.

NetBeans I don't have a strong opinion about; because, unlike Eclipse and IDEA, I've never really used it for a more than couple of hours at a shot. However I've spent months putting Eclipse and IDEA through their paces and for me the winner is clear. Eclipse is just a far more fluid and usable editor and development environment than IDEA.

IntelliJ could come back. Lord knows Eclipse didn't used to be this good, and NetBeans was unusable until quite recently, so it is possible for an IDE to improve. However to have a real chance, JetBrans is going to have to make a choice a lot of companies are afraid to make. They have to break with the old interface completely. They're going to have to reassign keyboard shortcuts by default, and reorganize menu items. Done right, a new interface could be so superior that there'd be only minor if any grumbling from the installed base. Done wrong, it can make matters much, much worse and even kill a product outright. However in the long term there is no choice. Eclipse and NetBeans are only going to keep getting better. Unless IntelliJ makes the hard choices, it's going the way of JBuilder and Visual Cafe.