4 ms·
It would be interesting to see how the Scala section would change after the release of Java 8 and especially the release of Kotlin. Java 8 introduced the bare m
by zests 6y ago
It would be interesting to see how the Scala section would change after the release of Java 8 and especially the release of Kotlin. Java 8 introduced the bare minimum functional programming support in order for the language to be used functionally. Not to mention libraries came out like reactive streams which essentially lets you write your entire code as chained function calls inside of an error monad.
Kotlin then made functional programming a first class citizen. Java is clearly recognizable inside of Kotlin under a bunch of layers of abstraction and syntactic sugar. Once you learn Java you can learn Kotlin with minimal effort and add more language features to your toolbelt as you get more Kotlin experience -- similar to what the author says about Scala.
Kotlin is probably not as advanced as Scala, and admittedly I've never used Scala, but it does seem to be taking some of Scala's market share.
- marceloabsousa 6y ago"Kotlin then made functional programming a first class citizen" - what do you mean by this?
- opnotme 6y agoNot OP, but I assume they meant: Kotlin encourages you to solve problems functionally, whereas Java merely allows you to do so. Kotlin provides features like top-level function declarations (don't need to be declared as methods of a class) and functions-as-arguments, both of which make it easier to think functions first.
- zests 6y agoIn Java if you want to map a function over a list you write `list.stream().map().collect()` and in Kotlin you write `list.map()`. The functional programming APIs in Java are atrocious. Lambdas are much easier to write thanks to anaphoric macros and other syntactic sugar. Data structures are immutable by default. A big one that isn't mentioned often is that functions can exist outside of classes so your code is not as tied to Java's style of OOP.