I recently did a pretty negative review of the IntelliJ and its Scala
support. Based on a lot of feedback and some very polite
posts from Ilya, one of the Scala plugin developers, I took another
look at IntelliJ. Based on spending more than a week with
IntelliJ, configuring and tuning it, I fail to understand why someone
would pay a dime for IntelliJ. I find it to be a poorly
thought out product. The Scala support has strengths and
weaknesses compared to the NetBeans Scala plugin. If you use
and like IntelliJ, you will likely disagree with this review and you'll
likely find the Scala plugin to be a good tool. If you
haven't used IntelliJ yet, don't waste your time.
I've been using programming editors since 1983 when I first started
doing C programming for the Apple ][. Despite this, I do not
think I'm a power user of programming editors. I have a few
things that I do and don't try to dig deeper. My favorite
editor of all time is Brief, but alas (and partially due to my
lawyering work), Brief is not longer available. Emacs is my
default editor of choice.
I write a lot of code, but I do it simply. I write code.
I compile code. I test code. I write
more. I open lots of files and usually have 2 or 3 projects
open at the same time. In rank order, the most important
things an editor can do for me are:
- Allow me to quickly navigate to the file I want to edit
- Find the lines in the file that I need to change/add to
- Give me real-time feedback about errors
- Format code nicely
- Support a very nice manual find/replace mechanism (Emacs is
king of this)
- Allow me to see more than one part of a file at once
- Support opening multiple projects and files outside of
projects quickly and easily
- Does not assume that I will be doing all my work inside the
editor... I use the command line a lot
- Open files based on a regular expression (e.g., emacs
$(grep -l Foo $(find . -name *.scala)))
While Emacs does most of this stuff very, very well, it doesn't support
real-time feedback on program errors, nor is its Scala formatting
particularly good. I was using jEdit for a while, but as the
NetBeans plugin matured, I switched to NetBeans. It does 1
and 2 well enough and is great at 3 and 4. NetBeans is still
beta. Its got its weaknesses, most notably class navigation
is particularly weak.
A couple of random things. First, I have a vested interest in
more better tools for Scala, so posting negative things about IntelliJ
is not in my interest. Second, Scala's object model,
implicits, traits, etc. make things particularly difficult for IDE
plugin writers. Third, I do not do automatic refactoring.
I find that it takes away from my understanding about the
code. Even if a refactoring takes me 2 hours rather than 30
seconds, the 2 hours is
always
well spent learning about how the code works.
I'm going to put aside my installation issues for IntelliJ on 64 bit
Linux. I outlined those issues in my last post. All
my testing was done on a Windows Vista machine. Installation
was flawless and IntelliJ fired right up. So far, so good.
I installed the 8.1 Diana EAP version of IntelliJ as I was told that
this was better for Scala work. I installed the Git, Maven,
and Scala plugins. I opened Lift and went for the most gnarly
file for an IDE: the Lift Textile parser. This 1,300 line
file results in about 2,000 classes. It's a big hairy mess
for an IDE. Good news, IDEA handles the file. Bad
news, IDEA finds a bunch of errors in the file, but when I edit the
file and insert junk, IDEA doesn't flag my typing errors. I
closed the file and try for something less nasty.
I went searching for another file to edit. I found one,
although it seems that browsing in IDEA is by class, not by file.
This is a challenge in Lift when packages often have hundreds
of classes. After a lot of rooting around, I found that you
can view a project by "Scope: All" and navigate by file.
I open another file, move to the line I want to edit and click on the
line. My cursor is at the click-point, rather than the end of
the line. This is kinda stupid. Why doesn't
IntelliJ just put the cursor at the end of the line (this and other
annoyances are configurable, we'll get to that in a little while)?
The editor is counter-intutive. Okay, I do some
editing. I do some code navigation.
The code navigation is clearly IntelliJ's strong point. I
navigate quickly through all of my Scala classes. For library
classes, IntelliJ provides me with method signatures that are enough
for me to understand what's going on. I'm starting to warm up
to IntelliJ. I'm liking the Scala plugin. It's
doing something that I haven't seen since Java in Eclipse... seamless
class navigation. I'm starting to understand why people like
IntelliJ and the Scala plugin.
I do some find and replace. Once again, IntelliJ is good at
this. Its editor makes incremental search, changing
something, and searching again a very simple task. It's not
quite as nice as Emacs, but it's better than NetBeans.
And this is as good as IntelliJ gets. The rest is a freaking
horror show.
I committed up my changes to Lift. I monitor Hudson and the
build is broken. It's broken in Textile. IntelliJ
frickin' saved my bogus changes to the Textile file. What the
f**k? So, I dimly remember that IntelliJ has an autosave mode
and apparently the autosave mode also marks the file as "added" to Git.
This is absolute stupidity. Unless I explicitly
save a file, it should not change on disk. So, I spend an
hour working through the preferences in IntelliJ. I disable
auto-save (this
should
not be the default!!!!) I set the editor up to
work the way most other editors work. I go back to work.
Even with auto-save disabled, IntelliJ saves file changes
automatically when
the editor is exited. This alone is a disqualifier for
IntelliJ. I haven't found a way to disable this behavior.
What the f**k are the IntelliJ folks thinking? If I
want to save a file, I'll save it. If I want to discard a
file, I'll discard it. The default behavior should be the way
most other programs are: files are explicitly saved.
The default editor behaviors are screwed up. The default
should be the way other editors work. If IntelliJ wants to
changed the paradigm, fine. But the mental cost of forcing me
to spend a lot of time navigating preferences makes me think the
IntelliJ folks are more interested in foisting their paradigm on me
than giving me a tool that works the way I want to work. At
the very least, there should be a simple option "Emacs mode" or
some-such that sets the various properties to work the way us old-time
Emacs kinda guys work.
As a side note, I did some work with the Talligent C++ class-based
editor back in the 90s. IntelliJ seems to have a paradigm
that's part of what Talligent was doing: navigate and edit the class,
not the file. Implicitly save changes, etc. If
there was an obvious change log that could be undone in a single
operation
and class-granularity
for the editor rather than file granularity (when you open a class, you
just see that class), the paradigm might work. Unfortunately,
the way IntelliJ has stradled between file and class-based editing is
an amazingly bad balance.
Next thing I did was open two projects. IntelliJ opens a new
window (they call it a frame, because different names are good?) for
the new project. Navigation across classes in the projects
worked well. I was feeling good, until I exited IntelliJ.
I later reopened it and only one of my projects was open.
This is once again a wicked bad design. I IntelliJ
keeps track of stuff, then it should keep track of
all the projects I
have open, not just the most recently edited project.
Other stuff that I find anoying about IntelliJ:
- Lots of flashing icons. Once I've clicked on the
icon, it should stop flashing.
- What are facets and why should I care?
- The default character set on Windows is the Windows
character set. This is brain damaged for any web-related work
(it should be UTF-8) and I haven't figured out how to change this.
- The icons are ugly. A commercial product, an
expensive commercial product, should look better.
- The JDK for a project is not automatically set.
Do what Eclipse does: if the JDK is not defined, prompt the
user.
- Sometimes IntelliJ just freezes without a wait cursor.
If IntelliJ is doing something, then let me know... don't
make me guess to see if the IDE has frozen.
The Scala plugin is in beta, so my comments are only applicable to the
current beta version. Ilya seems to care a lot about what
people think and seems to be working towards having the best Scala
plugin. So, the code navigation and syntax highlighting in
the Scala plugin are first rate. The stuff that doesn't work
so well for me are:
- Errors are flagged for default packages until the JDK is
defined. This one tripped me up until Illy told me to define
my JDK.
- Errors are not flagged as I type. It seems that
the Scala plugin detects errors about 40% of the time. This
is less than optimal. Errors should be flagged correctly.
- XML support is marginal. Yes, this is so hard
that the Eclipse plugin punts on it. I find a lot of pauses,
long ones, when I'm typing in XML.
- The code formatting choices are not the right ones.
There are Scala coding guidelines that EPFL uses.
These should be the defaults for the plugin.
- XML is not indented properly.
When I tried IntelliJ for the second time, I really wanted to like it.
I tried very hard to care about the positive feedback that a
lot of people I respect have about IntelliJ. I wanted to say
good things so I could answer the "how's the Scala tools support?"
question more positively. I'll even go farther. If
someone wants to send me configuration steps for IntelliJ to make it
work like NetBeans or Emacs, I'll spend another week using it.
I want very much to say good things about IntelliJ, but my
experiences with it are so overwhealmingly negative that I can't find
nice things to say beyond praising Ilya's work and progress with the
Scala plugin.
So, I'm not going to use IntelliJ. I'm betting the Scala
plugin will improve, but the overall horribleness of IntelliJ is so
overwhelming that I can't see using IntelliJ, even if the Scala plugin
becomes the best Scala plugin on the planet. Yes, I know that
a lot of people swear by IntelliJ. Great, for you guys, go
ahead and use it with the Scala plugin. For the folks in the
world who use programming editors the way I do, stay as far away from
IntelliJ as you can. It's a poorly designed piece of junk.