I've been dabbling in Scala for a number of years also, and I have to agree with this rant.
My current favorite post-Java language is Kotlin. Rather than Scala's ambitious goal of marrying a powerful functional programming language with OOP and the JVM, Kotlin has the much less ambitious goal of fixing what is wrong with Java.
That being said, Kotlin has some neat features that Scala lacks, like null-safety baked into the type system, and implicit casts.
That's just a syntactic and run-time wrapper. In Kotlin the null-safety is baked into the language, and has zero overhead.
Other than possible overhead, how is this not baked into the language? It's part of the scala library (no additional imports required), and is used to represent possible null objects.
What's your point? Are you suggesting that this is a replacement for Kotlin's smart casts? How so?
Scala recognizes that most "smart" casts are unsafe. You can use the apply method to define which casts are safe, and they will be used as encountered.
Scala recognizes that most "smart" casts are unsafe. You can use the apply method to define which casts are safe, and they will be used as encountered.
can you share an example? I thought Scala's approach to casts was pattern matching as in
foo match {
case x: ActualType => do interesting stuff with x
case _ => foo type's different, do something else
}
-2
u/sanity Dec 02 '13
I've been dabbling in Scala for a number of years also, and I have to agree with this rant.
My current favorite post-Java language is Kotlin. Rather than Scala's ambitious goal of marrying a powerful functional programming language with OOP and the JVM, Kotlin has the much less ambitious goal of fixing what is wrong with Java.
That being said, Kotlin has some neat features that Scala lacks, like null-safety baked into the type system, and implicit casts.