https://kotlinlang.org logo
Title
j

Jacob Richards

09/15/2019, 9:08 PM
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

Dominaezzz

09/15/2019, 9:10 PM
You do not have to start with java, unless you're working with a codebase that is mostly java.
j

Jacob Richards

09/15/2019, 9:11 PM
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

Adam Powell

09/15/2019, 9:15 PM
what other languages are you familiar with?
d

Dominaezzz

09/15/2019, 9:15 PM
IMHO, the languages aren't too different, you should be fine learning Kotlin now and picking java as the need suffices.
j

Jacob Richards

09/15/2019, 9:17 PM
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

Adam Powell

09/15/2019, 9:19 PM
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

serebit

09/15/2019, 9:29 PM
Going into Kotlin with existing knowledge of Java helps, but it isn't necessary to understand the language
a

Adam Powell

09/15/2019, 9:43 PM
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

Jacob Richards

09/15/2019, 9:45 PM
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

Adam Powell

09/15/2019, 9:46 PM
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

Jacob Richards

09/15/2019, 9:47 PM
all good! thanks so much for your help so far 😆 yep, joined that one.
a

Adam Powell

09/15/2019, 9:47 PM
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

Jacob Richards

09/15/2019, 9:49 PM
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

Adam Powell

09/15/2019, 9:51 PM
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