CTO at Visionary AG

We're moving from Java to Kotlin with our Microservice Stack (Spring Boot) because it is excellently supported by framework and tools and the learning curve is not very steep Kotlin is way more straightforward and convenient to use while providing less boilerplate and more strictness, which finally leads to better code, which is more readable, maintainable and less error-prone. We especially like Kotlin's (functional) data structures, which are, e.g. compared to Scala, easier to understand and don't require deep knowledge in functional programming.

READ LESS
8 upvotes2 comments37.7K views
Jean Casteaux
Jean Casteaux
September 11th 2022 at 12:28PM

IMO `Seq(a,b,c).filter(f).map(x => y)` (Scala) doesn't require any more knowledge in functional programming than the Kotlin collections 馃 Scala is not Cats nor Scalaz ^^ (which are FP-libraries known to be complicated)

Reply
Frank Neff
Frank Neff
September 19th 2022 at 1:53PM

Well, according to my experience, using Scala in a OO setup (without FP paradigms) does not make much sense. Indeed, the collections API is similar, but it reads to be a bit wanted. If one wants to use Scala in an idiomatic fashion, many frameworks and libraries actually rely on FP abstractions like Cats, ZIO, or fs2, while going functional on Kotlin is really a matter of choice.

I've been working with Scala and Kotlin, both for years: Beyond the before-mentioned "hello world" collection example, I think that Scala actually requires more FP knowledge and is logically and syntactically more complex than Kotlin. Of course, the good part is: Scala is more precise, correct, as well as more strict about types/structures and the compiler actually takes away a lot of OO pain. I would prefer it in many cases, but not for just being a "better java" with Spring.

Reply
Avatar of Frank Neff

Frank Neff

CTO at Visionary AG