I have a little question.. I do not know if I sho...
# announcements
p
I have a little question.. I do not know if I should choose Kotlin or Scala and why?
K 14
e
As was fairly noticed somewhere on this server, if there is a language feature existing, it probably is already in Scala. On the other hand, Kotlin introduces new lang features gradually and carefully, meaning that it's way easier to learn and to use, because you don't have to always deal with, for example, iMpLiCiTs, that some of your colleagues left undocumented or something like that
👍 2
m
Depends on what you're using it for or what you want to learn. Learning Scala is great for seeing a very strong typing system in action. Great courses/books on functional and has everything. So if your objective is to learn how far a language can go, Scala is your choice. Kotlin is more constrained (intentionally) and focused more on facilitating collaboration on a code base. Reducing 'obvious' errors and bad patterns and things like that. There is no right answer. If one was provably superior to the other, that would be the one we'd all use.
m
@Mike Well, it is not that is one language is better than another then everyone switches immediately. There are still some companies using COBOL. I also think that is is quite clear that Kotlin is superior to Java today.
Scala is a great incubator for ideas. It gives you a lot of freedom that is used differently by different developers. Kotlin is more pragmatic and oriented on good design. It is also more interoperable with other languages and it works way better with tools (IDE).
d
Lagging behind is Kotlin's main advantage, it can cherrypick good ideas from other languages such as Scala and C#, but leave out stuff that is too complex (for now)
👍 1
m
My comment was about there not being a clear winner/best and therefore your choice depends on your situation. Some would argue that kotlin is not provably superior to Java. But I definitely prefer it. To the point that I'm at a financial institution that's moving to micro services (aren't they all) and I got permission to use kotlin for my team. I'm currently mentoring 2 new teams that had choice, chose kotlin and are very happy. Coincidentally they are/were Cobol programmers. Any large Corp will have Cobol systems that are still actively maintained.
e
I'd suggest you kotlin of course. But the best is to try them both with a sample project and then see which you like at most
m
@Davio awesome point and as you say, overlooked. I'm adding this to my 'reasons to choose Kotlin'.
t
Like stated above by the others it also depends on your team. Using Scala you'd probably have to bring in more conventions on regulating the complexity that Scala offers (e.g.: one target outcome, many functionalities to reach the same goal), while Kotlin leans itself on Java (maybe one more reason to bring in to your arguments to use Kotlin) 🙂
m
@elect Simple project will look nearly the same on both 😄 I think the better comparison is to analyse some bigger projects in Kotlin and in Scala.