Ask HN: Functional programming in Kotlin vs. Scala advantages/disadvantages?
I am curious if there are any advantages or disadvantages in the are of functional programming comparing Scala and Kotlin.
Are there any important functional features that one has and the other doesn't?
10 comments
[ 15.4 ms ] story [ 276 ms ] threadOVERVIEW - Scala is much more of a functional programming language - Scala has a steeper learning curve - Scala community/ecosystem leans much more towards FP - Kotlin is like Functional Programming "lite"
LANGUAGE - Scala: has higher kinded types - Scala: has for comprehensions - Scala: has type classes - Scala: has built in support for monads - Scala: has better support for encoding errors at compile time
MARKET - Kotlin: has heavy usage on Android - Kotlin: on the server side is pretty active too - Kotlin: integrates nicely with java - Kotlin: multi-platform support
> My experience has been that you end up with more complex implementations than you wish you had to maintain.
Don't you get that with any language? I for one always find myself in a battle against complexity, no matter the language.
Metaprogramming or code generation is similar. You can certainly make smaller, more sophisticated solutions with it. I would consider that has a comprehensibility cost and need some justification for its use, if not merely for academic/learning purposes. Maintainability could go either way depending on the situation and team composition.