I hate Java. Can I use Kotlin without touching it whatsoever?
25 points| sergiotapia | 3 years ago | reply
Can I use Kotlin today without knowing/caring about Java?
25 points| sergiotapia | 3 years ago | reply
Can I use Kotlin today without knowing/caring about Java?
[+] [-] politelemon|3 years ago|reply
You'll also be wanting to use Java library at some point whose documentation is in Java, so you'll also have to be able to 'mentally translate' the documentation. One of the things you'll have to get accustomed to in Java as opposed to C# is just how many libraries you'll be importing, for features where the language itself either doesn't provide anything or provides a poor implementation.
[+] [-] smt88|3 years ago|reply
Writing Kotlin would not trigger your Java hatred at all. Configuring build systems is the same, but otherwise you won't have to do anything in Java that you hate.
As the other commenter said, the only thing you lose is (sometimes) reading docs in your language, but there is a decent Java to Kotlin tool built in to Jetbrains IDEs.
[+] [-] Grazester|3 years ago|reply
[+] [-] sigy|3 years ago|reply
[+] [-] Snacklive|3 years ago|reply
[+] [-] gavinray|3 years ago|reply
That means when you Ctrl-Click a third-party method to understand what's happening, you're going to get dropped into Java code.
This being said, Java is dead-simple -- and since JDK 17 with introduction of pattern matching, sealed types, multiline strings, records, and other things, it feels much more like C# or other modern languages than the Java you're likely thinking of.
Kotlin is probably my favorite language though, highly recommend giving it a shot.
[+] [-] ksec|3 years ago|reply
[+] [-] igneo676|3 years ago|reply
With Guest languages (Kotlin, Scala, Clojure, Fennel, etc) you almost always end up learning the original Hosted language. Heck, most languages have an FFI that you'll end up using at some point for C interop because it's all C at the end
But you've been coding for 24 years. You're experienced enough that you can ignore most of the differences and just go full Kotlin.
Most commonly though, you'll need to know:
1. The type system. Your IDE will largely handle the Java interop but not knowing how the type system works will still bite you
2. How the class path works. A lot of issues can be avoided if you understand the build system on this level
3. Your build tool (Gradle, Maven, etc). Basically for the same reason as the class path
If you can tolerate that, you're going to be fine with Kotlin. If you can't, well, good luck and Godspeed
Note: this is setting aside Kotlin's ability to target C and JS, but those are more uncommon use cases. And obviously decoupled from Java
[+] [-] philonoist|3 years ago|reply
So, you will be fine using Kotlin for problem solving even upto algorithms of Competitive Programming. But if you want to build real world use cases and projects, you will have to go through the Java Libraries and other ecosystems because nobody will rewrite them just because a new language came by with hype. That includes Android even though Google officially supports Kotlin.
Ofcourse, Scala and clojure are exceptions.
[+] [-] zkirill|3 years ago|reply
I also learned Kotlin to avoid Java which I hated since university. A few years later I now have a much deeper understanding and respect for Java, JVM, and the broader ecosystem.
[+] [-] origin_path|3 years ago|reply
So it really depends on what you mean by Java - the language or the VM/ecosystem/toolchains. If the former, yeah you don't have to care about it (you have to be able to read it at least a bit). If the latter then you'll find it frustrating. The JVM is theoretically optional but practically required as otherwise you won't have access to enough libraries. The C ecosystem just isn't competitive.
[+] [-] muzani|3 years ago|reply
Under the same logic, you might as well learn JS and C++ because you'll have to eventually deal with that.
[+] [-] 0n34n7|3 years ago|reply
Yes, if you don't have to use Java dependencies, otherwise, a little.
[+] [-] brokenbyclouds|3 years ago|reply
[+] [-] karmakaze|3 years ago|reply
[+] [-] ilovhn|3 years ago|reply
Sorry, not possible.
[+] [-] monroewalker|3 years ago|reply
[+] [-] Snacklive|3 years ago|reply
[+] [-] oxff|3 years ago|reply
Yes.
[+] [-] kamma4434|3 years ago|reply
[+] [-] unixhero|3 years ago|reply
[+] [-] dym_sh|3 years ago|reply