Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Holy shit! Niw that's what I call a "rubber duck"! Careful what crappy code you show it 😁
-
eeee31226y@brano88 null safe. And also safe for your mental sanity, thanks to:
- null safety (as mentioned) (i.e. stronger type system than Java)
- type inference
- superior generics
- no setters and getters, unless custom
- data classes
- extension properties and functions
- simpler immutable properties, fields and collections
- functional programming amidst object-oriented code and vice versa
- much nicer and more concise syntax
- ultra lightweight multi-threading (I've seen a demo with 100000 Kotlin coroutines run in a second, while the same in Java runs out of memory)
- sealed classes (enums on steroids)
- great utilities in the standard library, code blocks: let / run / apply / also / use etc.
To name a few.
Things only get complicated when you mix Kotlin and Java. Where they interoperate you really miss all the Kotlin goodness and sometimes you have to introduce ugly Java constructs because... Java. -
eeee31226y@brano88 of course everything in Kotlin is possible with Java; it's all the same byte code after all. However, you really don't want to repeat yourself, nor is it necessary, to create all kinds of boilerplate constructs, patterns and architecture while Kotlin has all that.
-
muliyul5766y@eeee I just wanna say something about coroutines.
People tend to confuse coroutines with multithreading because both are asynchronous paradigms while in reality they are different approaches to the same problem. They are not a new concept (coined by Knuth the in the late 50s).
Read more about coroutines here https://en.m.wikipedia.org/wiki/...
Related Rants
For those who wanted to know the difference.
joke/meme
original meme