📜 ⬆️ ⬇️

Eclipse Scala IDE - from a dead donkey's ears ...

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

Scala discovered for me the fascinating world of functional programming, brought back to the times of students with “spherical tasks in a vacuum” by Martin Odersky ...

But now he is two years old as Scala is dead to me. The blame 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 tooling.

If I can still put up with the time of compilation, then tool'ing ...

But first things first.

We, by force of circumstances, are tightly (and forever?) Chained to the Eclipse IDE. Somehow it happened that those projects that are needed for the workflow are only for Eclipse and they are not (and will not be) for 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 Eclipse Scala IDE?


In a nutshell - this is the most buggy, unstable and mysterious "crap" that I had to use for development in the XXI century. Simply speaking, you never know whether your scala code will be compiled for them, how long, what happens when you update Scala IDE, Scala, Eclipse, crash workspace and why your code will not compile with your colleague, and which diamonds will need to beat to make it all work again.

Here we need to make two clarifications: I am talking about mixed Java + Scala projects and Scala 2.11.x (this is the version on which we "surrendered" 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 projects like ours, it’s a horror and nightmare cleaner than an atomic war.

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] } 

Identical versions of everything (except for 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 correcting the source code (with 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 MacBooks.

This kind of magic happens all the time. For example, I had a project where autocompletion resulted in a crash of the entire project (but only if there was a link to the scala code in the files).

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

Source: https://habr.com/ru/post/350296/


All Articles