Thursday, August 14, 2008

A novice Scala programmer: Eclipse vs. IntelliJ IDEA vs. Netbeans. Debugger and for () yield {}

I continue my Scala IDE mini series I described my experience with installation of Eclipse, IntelliJ IDEA, and Netbeans applications and installation of Scala plugins in those environments.

The following simple code (from Programming in Scala, chapter 7) poses certain challendges to Scala debuggers. Some debuggers cannot stop on breakpoint placed, for example, on "val prod = (i * j).toString" line.
As Alexander Podkhalyuzin from JetBRAINS/Intellij IDEA Scala Plugin team said, "This problem goes to Java debugger problem with anonymous classes, because it's compile in different class file. So, we must to understand what name of this class files, and to set to each line, line in this class file. In Eclipse developers do this work, we have not implemented this yet, but you must be sure, it will be, because it is not convenient to work without for debugger."

As of today, Eclipse Scala plugin debugger can stop, the latest Intellij IDEA Scala Plugin debugger can stop as well. Both go even to a library Seq.class; Eclipse shows its code, IntelliJ IDEA shows interface, saying that it is "IntelliJ API Decompiler stub source generated from a class file. Implementation of methods is not available".
The latest and greatly improved NetBeans Scala plugin debugger still cannot stop here.


package chp7multitable
object Main {
/**
* @param args the command line arguments
*/
def main(args: Array[String]) = {
val multi = {
val table = for (i <- 1 to 10) yield {
val row = for (j <- 1 to 10) yield {
° val prod = (i * j).toString
String.format("%4s", Array(prod))
}
row.mkString + "\n"
}
table.mkString
}
println(multi)
}
}



1. Eclipse vs. IntelliJ IDEA vs. Netbeans. Installation.
2. Eclipse vs. IntelliJ IDEA vs. Netbeans. Creating and running Scala project with Eclipse.
3. Eclipse vs. IntelliJ IDEA vs. Netbeans. Creating and running Scala project with IntelliJ IDEA.
4. Eclipse vs. IntelliJ IDEA vs. Netbeans. Creating and running Scala project with Netbeans.
5. A novice Scala programmer: Eclipse vs. IntelliJ IDEA vs. Netbeans.
6. A novice Scala programmer: Eclipse vs. IntelliJ IDEA vs. Netbeans. Debugger and for () yield {}.