News for hackers. Stuff that matters.
Re:New language features since Java 8 to 17 by jmfldn on Sunday October 24, 2021 @02:45PM (#28980778)
I hear this a lot about Scala, and I am a Scala dev so maybe I'm biased, but I don't get the difficulty angle particularly. I'm in no way exceptional as a programmer or IQ-wise but I picked up Scala easily as part of my first job. The difficulty thing doesn't compute to me but it could just be that I'm well-suited to the language. It works beautifully as a better Java if that's how you wish to use it. Granted, it might be hard if you start with a "pure FP" codebase but most devs don't struggle picking things up on most code bases even as juniors.

The point about tooling and developer experience I'll concede. It has been at times patchy in Scala in the past but it's pretty good these days.

As I say, I have no hate for Kotlin, and I'll possibly use it one day being a JVM developer familiar with Java as well, I just find it unfortunate that a language which is so similar to the languages it's influenced by was invented.

Re:New language features since Java 8 to 17 by grumpyprole on Sunday October 24, 2021 @03:35PM (#28981172)
The first time I tried Scala, I got a type error based on the result of an implicit conversion, which succeeded locally but not for the entire expression. It took me a while to figure out what had happened. Advanced (mis) features such as this combined with encoding everything into objects with subtyping make Scala very complex. F# and OCaml are examples of much simpler languages that have most of the advantages (albeit no JVM).
Re:New language features since Java 8 to 17 by kaba0 on Monday October 25, 2021 @03:09AM (#28985177)
Implicits were majorly revamped in Scala 3, so do give it a look if you hadn’t already!
Re:New language features since Java 8 to 17 by jpgvm on Sunday October 24, 2021 @03:46PM (#28981257)
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.

Re:New language features since Java 8 to 17 by grogs on Sunday October 24, 2021 @04:33PM (#28981625)
Scala 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/exte...
Re:New language features since Java 8 to 17 by jmfldn on Sunday October 24, 2021 @04:32PM (#28981614)
It 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.
Re:New language features since Java 8 to 17 by erik_seaberg on Sunday October 24, 2021 @07:32PM (#28982917)
Every 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’.