2 ms·
It's difficult because the language is gigantic compared to Java, it has all the OOP bits Java has (and Scala needs in order to be relevant) then a whole bunch
by jpgvm 5y ago
It's difficult because the language is gigantic compared to Java, it has all the OOP bits Java has (and Scala needs in order to be relevant) then a whole bunch of FP stuff on top. This is a lot for newer programmers and while they might be able to do "hello world" equally quickly I do feel like they soon hit a wall of "I don't understand why this works" when looking at idiomatic Scala.
It can be used as a better Java but requires discipline. Things like implicits can easily cause an unnecessary amount of pain. Kotlin on the other hand implemented extension methods in a way that doesn't detract from the better Java paradigm. This is only one example though, there are many many reasons why Kotlin is more suited for the "better Java" role. Namely it's simply not that different to Java. It's effectively Java with a more modern syntax and polished extensions to the Java standard library.
- jmfldn 5y agoIt does require discipline, or at least one person on the team who can set a style guide for the newcomers to follow, this is true.
- grogs 5y agoScala 3 somewhat simplies implicits by the way. Especially w.r.t to extension methods, which are now a first class construct in the language: https://docs.scala-lang.org/scala3/reference/contextual/extension-methods.html https://docs.scala-lang.org/scala3/reference/contextual/exte...
- erik_seaberg 5y agoEvery worthwhile language brings important choices that require discipline. If there’s only one way to do anything, your experts’ code will be just as bad as your beginners’.