Kotlin is based on, and interoperable with Java, gets rid of some weaknesses/annoying things and and adds A LOT of stuff. key things:
strong, inferred, static typing and with explicit nullability (Int/Int?) and null-safe operators (nullableVariable?.foo()/nullableButNotNull!!.bar()). That's a big one imo, brings more compile time safety
A bit more FP while remaining OO. Lambda functions are often inlined by the compiler for better performance (someArray.forEach {} -> for-int).
Data classes. One keyword for a POJO one-liner. Just adding var/val makes constructor args a variable. data class User(val id: UUID, var userName: String) There's also the object keyword for Singletons with implicit getInstance()
Less verbosity. String templates("Welcome, $userName"). Implicit getters/setters. extends/implements -> :. when for both switch and if-else-if-else-if-else. Default arguments. Named arguments. Coroutines. async-await. Extensions. internal modifier (public, but only within the same module)
25
u/[deleted] Apr 24 '21
I am pretty sure that if my first language was C# I would've never become a dev. +1 for python tho.