I’ve started with Kotlin a couple of days ago and ...
# getting-started
j
I’ve started with Kotlin a couple of days ago and I’m pretty overwhelmed, because I don’t know ANY Java. I’ll be using Kotlin at my new job. Should I start with Java? If so, what’s the best resource for getting started with Java?
Currently building out a web server with Ktor, and I’m following along with a tutorial/extending the tutorial when necessary (eg. doing upserts with Exposed, foreign keys, etc)
d
You do not have to start with java, unless you're working with a codebase that is mostly java.
j
Right, that’s what I was hoping at first, but the only thing is that they’re using Dropwizard, and the docs for it are all Java. I feel like I’m handicapping myself a bit if i don’t know some java beforehand and jump into only kotlin?
a
what other languages are you familiar with?
d
IMHO, the languages aren't too different, you should be fine learning Kotlin now and picking java as the need suffices.
j
JavaScript (fullstack) and Python. That totally makes sense- I just got a bit worried when trying to read the Dropwizard docs, and eventually gave up and decided to use Ktor for developing a web server.
thanks for your responses, by the way 😆
a
you're probably fine then if you know ES6 and python already. Java itself is pretty straightforward, but the library ecosystem is known for being baroque
especially web libraries and frameworks
s
Going into Kotlin with existing knowledge of Java helps, but it isn't necessary to understand the language
a
after reading some of the dropwizard docs, here, yeah that's exactly the sort of thing I was referring to. 😄 There are good reasons why it's structured the way it is but don't at all feel bad if you don't understand what it's doing from the outset. Most of it is a bunch of reflection/annotation library magic trying to automate/codify domain best practices that the average java expert wouldn't know offhand either.
Kotlin/ktor just get the advantage of being able to autocomplete your way to success due to statically typed dsls powering most of it but you get a lot of the same concepts represented there
j
ah, i see! thanks for the info. yeah, ktor has been really nice, but i’m going to have to use dropwizard at the new job- how would you suggest i learn it, despite the fact that the docs are incredibly confusing to me?
i’ve seen a couple kotlin ports of tutorial projects for DW, so I was thinking that might be a good entry point.
i don’t understand the ecosystem really- what’s the primary framework folks are using for server-side KT right now? spring? DW? ktor?
a
I think you'd have to ask some others around here, my focus is Android and I keep up on some web stuff as a hobby 🙂
there's #server that might be helpful
j
all good! thanks so much for your help so far 😆 yep, joined that one.
a
seems like you already found it, yeah
I like ktor, spring boot seems popular and has a strong kotlin following, dropwizard looks solid but fundamentally java-based - which is fine, but you might find tying into other ideas like coroutines to be a bit manual
j
right, that’s the impression i was getting. it’s interesting that there aren’t really any tuts out there with DW and kotlin. i did find ONE article that has you implementing a ridiculously simple API which worked for me, but right when I started needing to consume or respond with JSON, I was lost hahaha
If I do get deeper into DW, I’m for sure going to write a tutorial for it, bc it’s v strange that one doesn’t exist for kt.
a
teaching is a great way to learn 🙂
💯 1
fwiw even after writing and using ktor adapter plugins myself I still find it more readable to do something like moshi serialization with their kotlin codegen plugin by hand, and then keep some plain extension functions around as helpers where needed
it's so painful in java and the java community has such envy over dynamic languages' parsing support that you end up with a lot of infra and annotation soup to close the gap in code golf competitions