This website collects cookies to deliver better user experience
TypeScript developer tries Kotlin again
TypeScript developer tries Kotlin again
Im getting there with Kotlin, try something 3 times and it might start to click. Here is my 5 seconds Rosetta stone on Kotlin classes
Comparisons
Lets break the above down
Kotlin
// this is an annotation @MongoEntity
Typescript
// this is a decorator @MongoEntity
Kotlin
// This class inherits from ProductBase but the primary constructor must be called, (Kotlin classes have more than 1 constructor) class PrivateProduct :ProductBase()
// the property called 'public' is a Boolean and it is initialised but you can prefix `lateinit` which is equal to the `!` in typescriptvalpublic: Boolean =false
What I like about Kotlin is most of the nice ES6 features have equivalent or near to concepts, destructuring, promises, reactive programming (alright thats nothing to do with ES6), array methods with predicate all that stuff its here in Kotlin, making the learning curve really nice for an experienced JS developer and even less for Typescript friendly JS developer.
Its very fast too, also I am writing an app using Quarkus - a web framework which has very very very fast hot reload, so I don't even miss this feature.