Hello, I'm a former python webdev new to kotlin tr...
# spring
q
Hello, I'm a former python webdev new to kotlin trying to get started on spring boot. However, I find the resources severely lacking. There were a single kotlin spring boot documentation in the official tutorials and I have failed to follow through because it omitted a lot of import statements( in which I only can guess that it should be obvious from the context). Now I am curious, is it possible to learn spring boot right away with kotlin or should I go learn spring boot in java and try to translate that into kotlin?
r
You should be able to use kotlin from starting. Spring has perfect support for kotlin. If you're facing problems with official docs, search GitHub for spring kotlin starter projects
q
I am aware that spring and its documentation supports kotlin. However I am not talking about support but about trying to learn kotlin-based spring with no prior knowledge of spring and a limited knowledge of java. From what I gather, spring boot ecosystem does not fare well with those without no prior knowledge of spring, and no resources exist to help. Therefore I am asking if I can pick up spring boot in kotlin or that I should learn spring boot in java first instead.
a
I think you should have no trouble learning SpringBoot with Kotlin. Spring.io has a very good tutorial complete with full source code (https://spring.io/guides/tutorials/spring-boot-kotlin/). Also, there's a somewhat briefer tutorial (again with source) here: https://kotlinlang.org/docs/tutorials/spring-boot-restful.html
a
There are very few Kotlin-specific things in Spring, so all Spring Kotlin tutorials are basically Java tutorials written in Kotlin. There are tons of resources for Java, so you might switch focus to them instead. It's nothing about Kotlin being bad or lacking support, it's just that Java is still a primary language for backend development. Kotlin has a decent interop with JVM and Java specifically (even automatic Java to Kotlin converter), so you can use tutorials in Java without a problem.
q
Thanks Alexander, that was what I needed to hear. So I would need to learn spring in Java and convert them to kotlin in the fly. I had a hunch but I did not know much about kotlin ecosystem to be sure.
c
I would really suggest reading https://www.oreilly.com/library/view/spring-boot-up/9781492076971/ as a great introduction to Spring Boot.
t
About the import stuff, most java/kotlin stuff assume that your IDE auto imports. Using IntelliJ fixes most of import issues, occasionally you will just have to decide from which jar to the the class and that’s it.