- If you are just looking for a better Java, Kotlin is likely the way.
- If you are looking for a better language that leverages the JVM ecosystem, then, Scala might be the way.
It also depends about what kinds of projects do you want to work with, Scala is a no-go for Android if you are just learning, on the other hand, if you plan to work in distributed systems, Scala is great for that.
The biggest advantage I see on Kotlin right now is the Multiplatform side, we are taking advantage from it to write a library once, that can be consumed by Android, iOS, and our backend services built with Scala (we even want it for the JavaScript side but it isn't as mature as Scala.js).
On the Scala side, it has a very nice ecosystem, with powerful tools that usually get ported to other languages, for example, its the first language where I see good tools for:
- Compile time checked SQL queries.
- Documentation tools that actually compile your code examples to make sure it is correct (even arrow-ank on Kotlin was inspired by tut from Scala).
- Generating JavaScript code that actually works.
While Scala may have had not-so-good tooling years ago, right now is pretty good.
People usually complain about over-complex code, which can be true, but, you can find bad code in any language, on Scala you can choose a path, whether to be pure-FP or pure when practical, and there is great tooling for any side, I personally try to be practical and it has worked quite well over many years (also check http://www.lihaoyi.com/ blog for similar examples).
What I get in Scala that I can't get in other languages I have worked with is usually the confidence that my code works when it compiles.
As of know, I use Scala for backend services, frontend (through scala.js), browser extensions, mobile apps by leveraging PWAs, and even native apps (through GraalVM).
On the job market, every year I see more companies using Scala, and you usually find very competent people which allows you to keep learning, on the Kotlin side, most job posts that I see are for Android than for backend development.
- If you are just looking for a better Java, Kotlin is likely the way.
- If you are looking for a better language that leverages the JVM ecosystem, then, Scala might be the way.
It also depends about what kinds of projects do you want to work with, Scala is a no-go for Android if you are just learning, on the other hand, if you plan to work in distributed systems, Scala is great for that.
The biggest advantage I see on Kotlin right now is the Multiplatform side, we are taking advantage from it to write a library once, that can be consumed by Android, iOS, and our backend services built with Scala (we even want it for the JavaScript side but it isn't as mature as Scala.js).
On the Scala side, it has a very nice ecosystem, with powerful tools that usually get ported to other languages, for example, its the first language where I see good tools for:
- Compile time checked SQL queries.
- Documentation tools that actually compile your code examples to make sure it is correct (even arrow-ank on Kotlin was inspired by tut from Scala).
- Generating JavaScript code that actually works.
While Scala may have had not-so-good tooling years ago, right now is pretty good.
People usually complain about over-complex code, which can be true, but, you can find bad code in any language, on Scala you can choose a path, whether to be pure-FP or pure when practical, and there is great tooling for any side, I personally try to be practical and it has worked quite well over many years (also check http://www.lihaoyi.com/ blog for similar examples).
What I get in Scala that I can't get in other languages I have worked with is usually the confidence that my code works when it compiles.
As of know, I use Scala for backend services, frontend (through scala.js), browser extensions, mobile apps by leveraging PWAs, and even native apps (through GraalVM).
On the job market, every year I see more companies using Scala, and you usually find very competent people which allows you to keep learning, on the Kotlin side, most job posts that I see are for Android than for backend development.