
Ask HN: Learning Kotlin if you don't know Java - outsideoflife
I want to learn Kotlin for Android development. I am a competent self-taught Python programmer. I have found a number of on-line and e-book sources about learning Kotlin, but to paraphrase all of the ones I have found say,&quot;Learning Kotlin is simple for someone who already knows Java&quot;. Well here is the thing, I don&#x27;t know Java! Is it really the case that to learn Kotlin I am going to have to learn Java first?!? Does anyone know a  good first book for learning Kotlin from scratch?
======
lucozade
You don't need to learn Java before you learn Kotlin. As you may notice in
your paraphrasing, it doesn't say you need to, it says it's simple if you know
Java already.

More concretely, what you'll find is that a lot of tutorials and books will
likely assume some familiarity with Java. Not necessarily to a point that you
can't learn, but more in regards to what they emphasise. For example, they'll
likely talk about nullability and Kotlin's approach to it. This makes a lot of
sense if you've come from Java but maybe less if you've come from a language
that doesn't have nulls.

Having said that, I would expect that, although learning Kotlin should be
fine, once you start developing in it, you'll soon find that you'll need to
have some familiarity with Java. The reason is that a big selling point of
Kotlin is its easy integration with Java. As a consequence, you'll probably
find that the libraries you'll want, beyond the basics, won't have been ported
to Kotlin. As there's not much call for this.

Unfortunately, I can't recommend a book for non-Java developers as I don't
know any Kotlin developers who weren't Java developers first!

------
chatmasta
I asked a very similar question last week, you might be interested in the
responses:
[https://news.ycombinator.com/item?id=16281374](https://news.ycombinator.com/item?id=16281374)

------
k120
I think that you should learn Java first because of all other Android code is
written in Java. It would be hard to stay in isolation without interacting
with other third party libraries. All Android ecosystem is written in Java.

------
adamnemecek
What language are you coming from?

Kotlin is a modern language comparable to swift, rust, Scala or ocaml.
Learning it is workthile as you’ll learn modern language concepts.

~~~
outsideoflife
I'm coming from Python.

~~~
adamnemecek
Might be tricky at first but embrace the type system, it’s a good tool for
larger projects.

You’ll have to bite the bullet eventually and Kotlin is a nice inroad.

~~~
outsideoflife
I am more than happy to embrace static typing, I wish it was an option for
Python (Yes I know about hint's)! I think I am going to do some beginner level
Java and get the basics of the language, and then switch over to Kotlin and
learn the advanced concepts there.

------
jimnotgym
Glad to hear it's not just me. I am considering just learning Java for Android
for exactly this reason

