Back
Close

Why Kotlin

kow
3,332 views
Previous: Integrations

Conclusion

Kotlin has been developed with a pragmatic approach and incorporates many "lession learned" of older languages. There is almost no downside compared to java, while being a modern and approachable language.

Wait, you said "no downside to java", this sounds like a sales pitch

Ok, let me elaborate: using kotlin is overhead, plain and simple: there is another compiler (arguably slower than java's), there is the overhead to learn a new language, and kotlin itself will never be the "first" language on the jvm.

More about the hidden costs of Kotlin on this wonderfull post on Medium.

And then there is always the possibilty to shoot oneself in the foot, with style, i.e. by using something idiomatic but having a performance overhead.

from https://craigrussell.io/2019/03/shooting-yourself-in-the-foot-while-adding-an-element-to-a-kotlin-list/

// { autofold
import kotlin.system.measureNanoTime
fun main(args: Array<String>) {
// }
val itemsToAdd = 5_000
val myList = mutableListOf<Int>()
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Having said this: I am sure that the benefits outweight the drawbacks big time when usig Kotlin instead of Java. You have to introduce this new language, teach the "right" way to do stuff in Kotlin, coach the developers and reflect the used patterns and techniques.

Kotlin, in a way, is more comparable to languages like typescript or maybe even c#.

Innovation is taking place at a breathtaking pace, while still managing to be simple enough to be the "first language" to learn.

If you want to try out kotlin: Just go ahead, or play with it

Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants