0
If we can convert both Java & Kotlin into each other then what is a use of learning Kotlin ?
9 Réponses
+ 6
Kotlin is less frustrating than Java. Also no NullPointerExceptions because Kotlin doesn't have nullable types and any null will fail at compile time :)
Another point is checked exceptions. It's a matter of preference, but Java tends to get cluttered with try/catch blocks, while in Kotlin there are no checked exceptions. Whether this is good or not and enforces better coding style/error handling is up for you to decide. It's a matter of preference I guess.
You can use delegates in Kotlin kinda similar to what you see in C#.
It all comes down to preference and taste. The fact that they are 100% interchangable even allows you to use BOTH at the same time, what's stopping you? Java might be a good basis to learn but is a bit of a dinosaur (but not like COBOL yet) and Kotlin is the shiny newer style with some more syntactic sugar on top. Love it or hate it.
+ 9
• A Few Thoughts About Kotlin and Why I Like It So Much — https://dzone.com/articles/few-thoughts-about-kotlin-and-why-i-like-it-so-muc?fromrel=true
+ 6
The last time I converted between them I spent 30 minutes fixing errors. It was for over 2K lines of code so faster than recoding from scratch, but I needed to understand both languages to correctly fix things.
+ 4
Brendon Bosman there are null pointer exceptions whenever you use: !!, if the value is null so: readLine()!! generates an exception on end of file.
+ 3
I read that with kotlin you can write a code in much less lines than with Java ,
+ 1
John Wells I didn't know that, that's pretty funny, thanks for sharing!
0
How we can do that?
- 3
Bonjour