Scala + IDE (looking for the holy grail)

Real Programmers (from XKCD)

This post is going to touch one of the most religious topics in coding: the IDE.

It doesn’t matter if it’s Eclipse vs Netbeans or Idea vs all of them, a developer loves and defends his IDE (most of them).

For a long time I have been a true follower of the Eclipse way of things. I loved its extensibility and the amount of available plugins. I really liked doing RCP projects and to work with Eclipse.

But since I started working with Scala I also wanted to take a look at the different IDEs out there.

I gave them all a little rundown. These are the results.

What I wanted to do

I already did some stuff with Scala and SBT and decided to start a small pet project.

Nothing too fancy. Some jMonkeyEngine flavor, playing with actors and reimplementing some algorithms.

After some playing around with jEdit, Git and SBT I started playing with the big three Java-IDEs.

Chapter 1: Eclipse

Naturally I started out using Eclipse.

Sure, I already knew the m2eclipse plugin was crap.

Crap like in

  • I can’t believe I got caught in the endless cycle of recompile again.
  • Dammit, it compiles on the cmdl but gives error warnings in the IDE?
  • Why, what, … ahhhhh it crashed again

I could continue for hours ranting about this abomination but it’s not the topic of this post. In the end I ended up uninstalling it and using the maven eclipse plugin like everybody else.

The next thing I tried was Eclipses Git support. The plugin looks very solid and didn’t give me any problems.

Finally I got to Eclipses Scala support. Eclipse features set of plugins (http://www.scala-ide.org/) to integrate Scala.

Sadly the state of these plugins is rather discouraging. Right now Eclipse (3.6 Helios in my case) will frequently hang while working on Scala files. Autocomplete looks more like guesswork and often misses some entries. Several times my whole Eclipse crashed while either refreshing a file I just had edited or trying to autocomplete.

Ah, and not to forget about the popup warnings.

A message to developers: If there is a problem that doesn’t crash your app or causes your project to spontaneously go up in flames don’t show a popup warning and make me click on a button. This makes the whole thing completely unusable for an impatient person like me.

Sadly, there is no other option for Eclipse. Right now I’d consider this thing an absolute no go.

The good news is that the Martin Odersky (creator of Scala) just joined the eclipse scala-ide which will hopefully lead to a way better IDE.

Chapter 2: Netbeans

Some history about my relationship to Netbeans.

I started out doing java in vi, then I switched to JBuilder. For a brief time I used Netbeans. I hated it.

It was horrendous experience. It was slow, a memory hog and slow. Did I mention it was slow.

So, after battling a full week against my mixed feelings towards Netbeans I downloaded and installed it (for this I tried both, 6.9 and 7.0 Beta 2).

I loved it. Netbeans allowed me to use the same shortcuts as Eclipse (relearning shortcuts is something I really wanted to avoid). The interface is clean and feels snappy. It comes with maven integration out of the box. And the maven support actually works.

So, things looked good on that front.

Next thing I tried was git support. From my limited testing I would say things look pretty solid. No crashes, no problems. But again: I just did very basic things there.

Note: Right now Oracle is developing an official plugin for Git.

And finally I tested the scala support.

Sadly Netbeans Scala support is as bas as Eclipses.

It crashes, it hangs, it doesn’t do auto complete most of the time and things sometimes get outright weird.

And again a message to developers: If there is a problem that doesn’t crash your app or causes your project to spontaneously go up in flames don’t show a popup warning and make me click on a button. This makes the whole thing completely unusable for an impatient person like me.

Chapter 3: IntelliJ IDEA

I haven’t payed for a Java IDE since JBuilder and I want to keep it that way. Luckily IntelliJ decided to change the way they do things and since IDEA 9 there is a free version. I got IDEA 10, the most current version as of this writing.

IDEA comes with maven support out of the box, just like Netbeans. Things simply work and I don’t have to perform black magic when importing a project, a big plus compared to Eclipse.

Git also worked without any problems.

Now for the scary part: Scala support.

It works.

Yes, autocompletion needs some work as sometimes not all options show up but it doesn’t crash and doesn’t force me to click on a damn pop-ups everytime something goes wrong.

It even comes with SBT support and decent syntax highlighting. There is still some work needed but it does a lot of the things I wanted and all I needed.

Wrapping up

Eclipse:

Git support is the only thing out of my list of requirements that did its job.

Maven support is utterly broken and the Scala IDE causes way more pain than is justifiable.

Netbeans:

Great Maven integration, Git worked without any problems. Scala support is broken.

I still really like the IDE and I am hoping to get back to it at some point.

IntelliJ Idea:

The clear winner.

Flawless Maven support. Working Git integration. A Scala plugin that solves more problems than it causes.

That’s it for now.

I am going to revisit the whole thing in a few months.

About codepitbull
A nerd, a geek, a software developer. Oh, and married ;)

29 Responses to Scala + IDE (looking for the holy grail)

  1. Maxim Zaks says:

    Really like the post

  2. nuttycom says:

    I’d say that Netbeans’s support isn’t completely broken so much as it is completely fragile. It works well for me, but with some serious caveats. First, it works well only if I’m using a Scala project that’s built with Maven; second, it is necessary to actually build the project from the command line prior to opening it in the IDE; apparently the plugin can make better use of the compiled classes to get the types figured out across the project than it can the source. Finally, the installation procedure that’s specified on the site for the netbeans scala plugin resulted in a broken plugin the last time I checked, but if you use 6.9 (or any minor version thereof) with the binary scala plugin downloaded from erlybird.sourceforge.net, it seems to work okay.

    • codepitbull says:

      I should have elaborated on that a little more.
      I agree that the Netbeans plugin can be made to work in some way.
      My biggest gripe with it are the pop-up warnings and if it wasn’t for them I might have continued working with Netbeans and never tried Idea.
      The problems you mention are nonexistent in Idea and therefore give me way more streamlined experience.
      With the release of Scala 2.9 I will redo my little experiment.
      (By the way: I really like Netbeans, been using it for some work with Glassfish)

  3. Jamal Burgess says:

    Great post…intellij is the best IDE…and funny as it sounds..emacs/ensime has the best autocompletion so far. Cliche comment but it’s very true.

    • codepitbull says:

      Thanks for cliche 😉
      I still have to get used to IntelliJ, relearning shortcuts sucks.

      • v6ak says:

        I’ve seen somewhere in IDEA settings an option to remap keyboard shortcuts. It is probalby. Better than you thing, because it has some preconfigured layouts for users of other IDEs 🙂

      • Ben says:

        They include an eclipse keymapping, that has 99% of the shortcuts, the rest are pretty easy to add.

        File > Settings
        Keymap > Keymaps > Eclipse

      • codepitbull says:

        Whups, didn’t see that one.
        I will fix the post to include that.
        Thanks a lot.

  4. Thanks for this post. I enjoyed reading it ver much and I think it is a good thingbthat the scala tooling gets some attention. It is a sad thing though that it is possible to win a test like this and still suck. Yes, intellij currently sucks the least scalawise of the three tested. It’s sad though because it is still beyond terrible. Performance is downright horrible when your project reaches about average size.

    I have high hopes for eclipse when it comes to scala support. I have received the unofficial explanation why the eclipsesupport sucks so much. Let’s just say that it sucks for a reason and making it not suck was not high up on the priority list, it is now. I think it will help all ide vendors that Odersky now updates the compiler to be better suited for “presentation compiling” and made the switch from emacs to eclipse himself.

    When it comes to maven support my soltion is to not use maven for scala development 🙂 (or any development if I have a choice). I think the m2eclipse plugin was the worst thing that ever happened to eclipse. It makes the only truly great thing about eclipse suck: incremental compiling. Good thing for other ide vendors though since they are suddenly not so much behind in the primary thing that matters: fast feedback.

    When it comes to intellij I can see why it clearly wins an evaluation like this one. After using intellij on daily basis for 3 months I still agree that it sucks less than the other two (have not tested the versions of the eclipsesupport in development) but it is still pretty useless.
    I’m currently on ensime with sbt and while it’s not perfect it doesn’t make me want to kill myself, and running my tests frequently is an option again.

    • codepitbull says:

      Thanks 🙂
      I have been using SBT for some time and I really love it and I think it shows the direction build systems should take. Personally I need to work with a lot of different java libraries and I want to be able to integrate Scala into java enterprise apps. In that area one has to deal with rather complex pom-layouts and interdependencies which SBT can’t and probably will never handle.

  5. steve says:

    Which Scala versions/plugin versions did you use to test the IDEs with?

    IDE support has considerably improved with Scala 2.9, so it might make sense to have a look at it.

    • codepitbull says:

      Sorry, but for the things I do I need to stick with the stable branch of Scala right now (which is 2.8.1). I am looking forward to the improvements but already went through the pain of working with a non-finalized version when starting with 2.8.

  6. v6ak says:

    Umfortunately, I’ve to agree. IDEA seems to be the only IDE that works well with Scala. I’ve an related observation: I choose IDE according supported technologies. The first IDE I was using was Eclipse. If you think that I was using it for Java, you are right 🙂 Leter, I tried it for C and PHP. C support semmed to be awful and unusable. PHP support was better, but not very well. Later, I switched to NetBeans for PHP development. But neither Eclipse nor NetBeans seems to be good for Scala. I’ve seen an advertisment for NetBeans saying that it is the only IDE you need, but I can’t agree. I can’t choose any IDE and say that it is definitely the best IDE for all languages and technologies.

    BTW: I’ve heard about ENSIME. This is a plugin for Emacs and is seems to be better that some IDEs for Scala. I’m not an Emacs fan and I don’t have tried this plugin, but it might be also interresting for someone.

    • codepitbull says:

      Picking IDEs is a tricky thing. I try to use the best tool for the job.
      When I did C/C++ I used Visual Studio or Borland C Builder. While doing PHP (a loooooong time ago) I mostly used vi.
      With Scala I got into the problem that my previous “best tool” for working on the JVM in general just didn’t do the job.
      So I am basically not looking for the best Scala tooling but for the best JVM tooling.
      ENSIME might be worth but as I have been a true follower of Eclipse I still am a true follower of vi ;D

  7. I’m in two minds about IDEs

    They’re great for managing wieldy projects (unparalleled refactoring/search facilities being a major bonus) and there are a lot of features like in built debuggers and so on

    But the flipside is they’re absolutely fucking huge bloaty clouds of woe that will gobble up most of your memory for breakfast, especially when you’re just using them on small projects or one off scripts. I use a 2007 edition Macbook with 2GB of RAM, the time it takes IntelliJ to load is an absolute joke and working with it is like running though a vat of treacle, slowly, cumbersome and generally very sticky. The same thing can be said about Eclipse and Netbeans.

    This isn’t really the fault of the IDE developers – I should be upgrading my laptop soon to meet the demands of todays applications, but the whole experience leaves a bitter taste in my mouth (and eating too much treacle will make you sick)
    So I’ve stuck with Vim for most things, nice and lightweight, fairly quick but it does have its pitfalls at the same time.

    I wish there was a middleground. Some of the features of the IDE but stripped down enough to be fast like VIM but more usable

    • codepitbull says:

      Honestly, for a long time I thought the same way and used vi with some skripts.
      But I got lazy and today I don’t mind the bloat that much as I used cause I see what I get.
      On the other hand, I never use the prebundled versions of an IDE (like Eclipse-JEE) and always only install the things I need.
      I also often have more than one IDE-installation on my disk containing different modules sets.

  8. Milos Kleint says:

    “If there is a problem that doesn’t crash your app or causes your project to spontaneously go up in flames don’t show a popup warning and make me click on a button. This makes the whole thing completely unusable for an impatient person like me.”

    Well, in non-beta versions you shall not get any popup messages, but only an icon flashing shortly in the status bar. in beta/dev versions the message box pops up precisely because devs want people to report the problems found.

    • codepitbull says:

      I don’t really agree on this point. The beta version is the only one working on Helios and I don’t really think people test things if error-reports simply breaks their work rhythm.

  9. David Bernard says:

    About Eclipse,

    I suppose you use the update-site linked for helios. But can you give an other try to eclipse support but with the following update-site :

    http://download.scala-ide.org/update-1.0.0-milestones-2.8.1.final

    It should replace the update-site for galileo and helios in few days (I hope).

    I also suggest you to follow instruction at :
    https://www.assembla.com/wiki/show/scala-ide/Setup

    (disclaimer, I’m committer to scala eclipse plugin)

    • codepitbull says:

      I am really sorry. WordPress decided to label your response as Spam and I just found it.
      Thanks for the post and I will try Eclipse in afew weeks, for now I am happy to be able have something that works and my lust for Scala beats my lust to try out other IDEs 😉 (for now)

  10. Pingback: IntelliJ IDEA, Scala and Continuous Builds (with some Mac OS X details) « Codepitbull's Blog

  11. Jonathan says:

    A great feature of IDEA: it can convert a Java source file to Scala in a single keystroke. Amazing!

    It doesn’t work 100% (obviously), but saves soooo much time. I’m planning to use this as a first step in learning Scala: convert an existing Java project to basic Scala then rewrite in a more idiomatic style.

    IMHO this is a game-changing feature for many people.

  12. Quite a late entry for this post. Originally an emacs guy till 2005 and then with huge force started using Eclipse and became so attached to Eclipse until yesterday. Started to work with scala and hence got all the latest from all the references for Scala programming in Eclipse. One of the main reason for me to use IDE was auto complete because it makes you code so fast. i got this page when i got stuck in Eclipse for auto complete. As per your recommendation got intelij and did couple of scala programs in it. Amazing! Though it was slower than Eclipse it was amazingly intuitive for scala. it even allows you to mix Scala and java classes within the same project unlike Eclipse.

    Thanks a lot for your post.

  13. Pingback: Getting Started with Scala « Ravi Sinha's Weblog

  14. bmdesignhki says:

    Great blog post – great comments! 🙂

    I am going to try Eclipse “Juno” and the official Scala IDE plugin on it.

    Note: To get the Scala IDE to work, install from this URL: http://download.scala-ide.org/nightly-update-juno-master-2.10.x (they have some incompatibility issues with “Juno” since months back!)

    If you have the time to also test it, would love to hear your comments.

  15. bmdesignhki says:

    Done my Eclipse Battle now. Got it to work (kind of) via sbteclipse, until I face this game-changer.

    <<
    Before you begin, make sure your Scala sources follow the Java convention for packages. Each package should appear in its own directory with the same name. Eclipse expects this convention to be followed when it looks for classes.
    <<

    Well, coming to Scala from a non-Java background, I really, really, really don't want to do this. I have src/*.scala and test/*.scala. My Scala files do contain more than one class. I hope such limitation will be lifted from Eclipse within the next decade.

  16. codepitbull says:

    It’s a pitty how bad Scala-support in Eclipse still is. Things are constantly breaking at I lost patience. I am still using Eclipse for Java-development, but for Scala I switched to Idea and most recently to Sublime Edit 2. The last one doesn’t have the features of most modern IDEs but it is fast and a good way to get the basics of Scala harc wired into my brain 🙂

Leave a comment