Eclipse Scala IDE - From Dead Donkey Ears ...

Scala is an amazing programming language that I enjoyed about 4 years ago. I was probably his fan: I bought books and courses at Coursera, used et cetera, et cetera, et cetera in pet and productive projects.

Scala opened for me the fascinating world of functional programming, returned it to the time of my student days with “spherical tasks in a vacuum” from Martin Odersky ...

But now he has been dead for two years as Scala. The reason for this ...

No, not Java 8, and even, most likely, not SBT with its mysterious incremental compilation, but the Eclipse Scala IDE.

To Scala, as an ecosystem, I have only two complaints: exorbitant compilation time and disgusting tool'ing.

If with compilation time I can poorly put up with it even worse, then tooling ...

But first things first.

We, by force of circumstances, are tightly (and forever?) Confined to the Eclipse IDE. Somehow it happened that those projects that are needed for the workflow are only under Eclipse and they are not (and never will be) under IntelliJ IDEA (for example, the same BIRT ).

Yes, no one forbids me to use Scala and IntelliJ IDEA for pet projects, but this is not so interesting and much more pleasant to have fun with IntelliJ IDEA and Clojure (I, of course, talk about Cursive ).

What is wrong with the Eclipse Scala IDE?


In a nutshell - this is the most glitchy, unstable and mysterious "crap" that I had to use for development in the XXI century. Simply put, you never know if your scala code will be compiled by them, how long will happen when updating the Scala IDE, Scala, Eclipse, crash workspace, and why your code will not be compiled by a colleague, and in which tambourines you will need to beat so that it all works again.

Two clarifications need to be made here: I'm talking about mixed Java + Scala projects and Scala 2.11.x (this is the version on which we “gave up” and decided not to continue the story with Scala).

Perhaps the Eclipse Scala IDE is ideal for “pure Scala” projects, but for complex and mixed ones like ours, this is a horror and nightmare cleaner than atomic warfare.

An example of yesterday. Two computers with Eclipse Oxygen.2 (4.7.2) with OSX.

package com.XXX
import java.util.{List=>JList}
import scala.collection.JavaConversions._
...
abstract class REScalaVariablesConfiguration {
	def calculateVariables (runtimeObject: GBObject): JList[Variable] = {
	    val result = for {(name, result) <- variables(runtimeObject)
	    				  if result != null
	      			 } yield result match {
	      case x:LWDecimal => new NumberVariable(name, x.getJavaDecimal, runtimeObject)
	      case x:Number => new NumberVariable(name, x, runtimeObject)
	      case x:String => new StringVariable(name, x, runtimeObject)
	      case x:Boolean => new BooleanVariable(name, x, runtimeObject)
	      case x:LWDate => new DateVariable(name, x.getJavaDate, runtimeObject)
	      case _ => throw new IllegalStateException("Not supported result type for rule engine variable: " + name)
	    }
	    new ArrayList[Variable](result)
	}
	protected def variables(runtimeObject: GBObject): Map[String, Any]
}

We get identical versions of everything (except for the JVM and OSX versions) when compiling Eclipse:

  1. SBT builder crashed while compiling. The error message is 'Could not create directory / XYZ / lib / print'.
  2. Error in Scala compiler: REScalaVariablesConfiguration

Slightly tweaking the source code (while compiling the "native" SBT, it compiles without problems)

package com.XXX
import scala.collection.JavaConversions._
...
abstract class REScalaVariablesConfiguration {
	def calculateVariables (runtimeObject: GBObject): java.util.List[Variable] = {
...

I manage to get rid of errors, but only on one of the MacBooks.

Such magic happens all the time. For example, I had a project where autocompletion led to the crash of the entire project (but only if the files had a link to scala code).

Colleagues, is this something going wrong again with me or do you have a similar experience with Scala?

Only registered users can participate in the survey. Please come in.

Evaluate your experience of using Scala in real projects

  • 22.4% 2.12 - normal flight, Scala only 29
  • 16.2% 2.12 - normal flight, mixed projects 21
  • 15.5% 2.11 - normal flight, Scala only 20
  • 14.7% 2.11 - normal flight, mixed projects 19
  • 17% Everything is bad 22
  • 6.2% Eclipse 8
  • 71.3% IntelliJ IDEA 92
  • 3.8% NetBeans 5

Also popular now: