Struggle against habits formed by Java when migrating to Scala

后端 未结 7 684
星月不相逢
星月不相逢 2021-02-01 08:48

What are the most common mistakes that Java developers make when migrating to Scala?

By mistakes I mean writing a code that does not conform to Scala spirit, for example

7条回答
  •  隐瞒了意图╮
    2021-02-01 09:39

    It's quite simple: Java programmer will tend to write imperative style code, whereas a more Scala-like approach would involve a functional style.

    • That is what Bill Venners illustrated back in December 2008 in his post "How Scala Changed My Programming Style".
    • That is why there is a collection of articles about "Scala for Java Refugees".
    • That is how some of the SO questions about Scala are formulated: "help rewriting in functional style".

提交回复
热议问题