I’m considering migrating from Java to Kotlin, but when I searched for tutorials I’m so overwhelmed by those tutorials that are targeting Android specifically, while I just want to do some desktop and backend apps and never wanna do Android development…
Are there any good ways to deal with this? Should I just read and watch Android tutorials and learn from them? or there are some other good ways to get familiar with Kotlin’s ecosystem? or I have to heavily rely on Java libraries? or should I just choose another language?
I myself don’t really know many good tutorials although I’m sure there are a few out there. https://kotlinlang.org/docs/tutorials/ is a good point to start.
After going through koans you can just convert some java files to kotlin (Intellij feature) and see how it feels. Switching from java to kotlin is quite simple. You should take a closer look at how higher order functions and inlineing works in kotlin but appart from that everything else should be pretty much intuitive. Another pain point could be immutable vs readonly vs mutable. Lot’s of people seem to think that val or List<T> are immutable even though they are readonly.
The kotlin eco system (at least on the jvm) overlaps quite a lot with java. This is one of the big selling points for kotlin. Using java libraries is simple and just works as if they were written in kotlin. So yes and no. You can rely on java libraries, but you can also find kotlin alternaties. One big one would be kotlin coroutines.
In the end that depends on you and your project. Not every language is the best for every situation, but I’d say that kotlin is supperior to java in most if not all situations.
I figured out that there are toolbox projects that cover almost all language called awesome-xxx (e.g. awesome-kotlin), and there’s a lot of stuff I can use as libraries
seems I have to do a lot of C++ binding works to do when comes to native development and the ecosystem wasn’t so matured
I don’t consider myself adopted if I only get the core/official stuff familiarized, libraries, architectures, and these ecosystem stuff are much more important when you really sit down and do some project
But I feel so sweet when I’m reading through the tutorial and references, Kotlin is such a cool language
Well, kotlin native is still in it’s early stages and still considered experimental. There are some efforts to create libraries for K/N or multiplatform but of cause they aren’t as exhaustive as the java ecosystem.
Well you said that you are switching from java so the ecosystem isn’t changing. Kotlin JVM uses all the same libraries that you would use with plain old java. There are kotlin alternatives but they aren’t necesarially better if you are familiar with a java library already.