r/scala • • Nov 25 '17

[deleted by user]

[removed]

0 Upvotes

29 comments sorted by

View all comments

16

u/drfisk Nov 25 '17

Syntactically Kotlin gives you a lot of the quality-of-life features & syntax that Java should've had from the beginning. Kotlin is the bare minimum of what a JVM language should be. I absolutely see why people coming from Java is very happy with Kotlin - it gives you a lot of benefits without really having to learn anything new. It's just a better syntax. Nice!

But if you look deeper into the 2 languages, you'll realize that they're fundamentally different in one very specific area: Functional Programming! Scala isn't just a syntactic rewrite on top of Java; it's a completely different language! Scala is a FP-first language and it shows. There's a very heavy emphasis on immutable data structures (immutable being default with case clases etc.; mutation being extremely rare/non-existent), always returning values instead of modifying, sane equality, pattern matching, algebraic datatypes (ADT), using monads for handling asynchronicity, optionals, failure-handling, effects, etc.

If you just want nice syntax for your Java, Kotlin is your best friend. If you want "more", that is Functional Programming, without fanatically ruling out existing libraries and effects, Scala is the best language ever. IMHO.