Some opinions on Scala tooling, esp. Eclipse vs Intellij, SBT and sbt-idea

323 views
Skip to first unread message

Ben Hutchison

unread,
Jan 5, 2013, 9:40:53 AM1/5/13
to scala...@googlegroups.com
<tldr>

1. Eclipse is still less polished & less reliable than Intellij for
Scala development.

2. SBT support for project->project dependencies is still clumsy.

3. sbt-idea is currently a bit broken, it needs to focus on emitting
Intellij Module descriptors, not Project descriptors.

</tldr>

I use both Eclipse and Intellij as IDEs for Scala development. I tend
to flip back and forth, unable to get completely comfortable with
either.

I've got an understanding for how Eclipse works, accumulated over many
years of usage, so that would be my preference if they were otherwise
equal. But I find it noticeably more buggy than the Scala support in
Intellij. Eclipse bug examples include the unreliable refactoring
tools, spurious compiler errors, and the close-curly-brace auto-insert
"anti-feature".

I always run SBT in the background alongside the IDE, for the maven
dependency managements, as well for second opinions on compiler
errors. So this requires using sbteclipse and sbt-idea to synchronize
the SBT project metadata into each IDE.

The experience of jumping between these 3 tools, and constantly
mapping the concepts between them, has dragged me through several
frustrations, which are the subject of this email.

Eclipse's core model of Projects in a Workspace is conceptually clear,
modular and flexible.It's strength is that it makes a minimal
assumption about what Projects in the same Workspace have in common:
that the user wants to view them together, and that dependencies are
satisfied. The modular nature of Eclipse Project dependencies means
that you simply declare what other visible projects you depend upon.

Neither SBT nor Intellij's models are as clearly or neatly expressed.

Now, Intellij's Projects are roughly equivalent to Eclipse Workspaces,
while Modules map to Eclipse's Projects. So fundamentally Intellij's
model is pretty equivalent to Eclipse's, and offers similar
modularity. But the naming and the description of the Intellij model
is misleading. Eg, I find their description of a Project as an "an
organizational unit that represents a complete software solution"
quite indistinct and "hand-wavey". It doesn't emphasize enough that
Modules are key, the unit's of reuse, and can be members of many
Projects at the same time.

And this mislabelling of the concepts in the Intellij model does,
alas, mislead people and have real consequences. If you grok Intellij
& SBT, it becomes clear that an SBT "Project" is basically equivalent
to an Intellij "Module".

But alas, when sbt-idea generates Intellij descriptors, it creates an
Intellij Projects for SBT Projects Oh noes! In Eclipse parlance, a
new top-level workspace for every SBT project. That leads to
brokenness like this [https://github.com/mpeltonen/sbt-idea/issues/79]

And pursuing how sbt-idea tries to support multi-module projects leads
towards multi project support in SBT itself :( Why, when its so easy
to depend upon a binary artefact in SBT, is it so clumsy to depend
upon another project?

Firstly, you cant declare project dependencies in .sbt files. Ugh!
Ether fix it or deprecate the sbt dialect and go back to .scala files.

And secondly, the suggestion of parent-child relationships
[http://www.scala-sbt.org/release/docs/Getting-Started/Multi-Project.html]
to model dependency graphs is neither necessary nor particularly
modular. There is no need for a root container project at all, just
each project declares paths to projects they depend upon. That's all
that's needed.

-Ben

Jonathan Merritt

unread,
Jan 6, 2013, 5:31:00 PM1/6/13
to scala...@googlegroups.com
I agree with your comments about Eclipse and sbt.  I don't use IntelliJ at the moment though.  How does IntelliJ do with 2.10 features; is it up-to-date with those?

Does anyone use (Emacs | Vim | Sublime Text 2) + ENSIME?  I haven't felt comfortable leaving Eclipse behind, since I seem to rely on it somewhat more than I should, especially for imports, code completion, and navigation around code I haven't touched for a while.  I would love to hear some cheering and encouraging success stories from the "we don't need no stinking IDE" crowd though (assuming such people exist in the mainstream :-).

Jonathan Merritt



-Ben

--
You received this message because you are subscribed to the Google Groups "Melbourne Scala User Group" group.
To post to this group, send an email to scala...@googlegroups.com.
To unsubscribe from this group, send email to scala-melb+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scala-melb?hl=en-GB.


King Lung Chiu

unread,
Jan 8, 2013, 1:06:01 AM1/8/13
to scala...@googlegroups.com
I use NetBeans (7.1.2) with the Scala plugin, which works with Maven projects.

Haven't used Scala in anger though - hence haven't needed to do much
Scala refactoring - so can't comment on the NB refactoring tools.
Though they seem largely non-existent / non-usable for Scala, except
the basic variable / method renaming.

I don't use SBT, but have noticed its folder structure is the same as
Maven's, so for experiment projects, I put SBT's cofig in the same
Maven project and then can use the SBT / Scala console to test things
out. (Yes, SBT config pulled out from the course last year :-)

Personally, I find Eclipse a bit too hard to setup / use, so I've stuck with NB.

cheers,

King

Ben Hutchison

unread,
Jan 8, 2013, 10:38:04 PM1/8/13
to scala...@googlegroups.com
I havent tested 2.10 features in anger but Intellij did accept an
"implicit class" so it must have 2.10 awareness.

If you're a Scala dev who likes using IDEs, I think its worth trying
Intellij for an hour or two - its a free, easy download and it can
import Eclipse projects - just to get a sense of perspective and
"what's possible"...

I know it's quite a conceptual shift from Eclipse. But alot of things
just work better in Intellij. Code completion is one example: although
it technically 'works' in Eclipse, the suggestions it proposes often
totally miss the mark. For example, it will propose reams of distant
classes from never-used packages over local variables.

Im a long time Eclipse guy myself, and I think its Workspace model is
superior, but I can't deny the distinct difference I currently
perceive in terms of overall quality.

-Ben

Jem

unread,
Jan 8, 2013, 10:47:36 PM1/8/13
to scala...@googlegroups.com
I think Eclipse only has overwhelming community support because of early mover advantage. The broken window syndrome is in full effect with Eclipse. Developers using it very quickly learn that obscure and unreasonable errors from their IDE are a natural part of the development process. IntelliJ puts the focus on quality first, and it shows.

Yes, I'm an IntelliJ fanboy.

Jason Zaugg

unread,
Jan 9, 2013, 2:07:44 AM1/9/13
to scala...@googlegroups.com
On Wed, Jan 9, 2013 at 4:38 AM, Ben Hutchison <brhut...@gmail.com> wrote:
I havent tested 2.10 features in anger but Intellij did accept an
"implicit class" so it must have 2.10 awareness.

Yep, it's aware of all the new language features in 2.10. It even has new Intentions [1] to help you migrate existing code to take advantage of String Interpolation [1].

Certain use cases for macros (still marked as 'experimental') will pose a challenge for IntelliJ, as it doesn't use Scala's presentation compiler. JetBrains is cooperating with the Scala team to look at this problem, but it takes time to solve.

Finally, JetBrains have recently plugged in the Zinc/SBT based Scala compiler [2]. Long story short, this means you can benefit from the incrementality of SBT compilation even if you don't use SBT as your build tool, and the because IntelliJ leaves the compiler running in a background process, you are always using a "hot" JVM (with classes loaded and code JITed.) That feature will be included in an non-nightly release to go with IntelliJ 12.0.2 real soon now, or you can try it with the EAP build of IntelliJ and a nightly build of the Scala plugin.

-jason

Reply all
Reply to author
Forward
0 new messages