TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Learning Kotlin if you don't know Java

10 点作者 outsideoflife超过 7 年前
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,"Learning Kotlin is simple for someone who already knows Java". Well here is the thing, I don'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?

5 条评论

lucozade超过 7 年前
You don&#x27;t need to learn Java before you learn Kotlin. As you may notice in your paraphrasing, it doesn&#x27;t say you need to, it says it&#x27;s simple if you know Java already.<p>More concretely, what you&#x27;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&#x27;t learn, but more in regards to what they emphasise. For example, they&#x27;ll likely talk about nullability and Kotlin&#x27;s approach to it. This makes a lot of sense if you&#x27;ve come from Java but maybe less if you&#x27;ve come from a language that doesn&#x27;t have nulls.<p>Having said that, I would expect that, although learning Kotlin should be fine, once you start developing in it, you&#x27;ll soon find that you&#x27;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&#x27;ll probably find that the libraries you&#x27;ll want, beyond the basics, won&#x27;t have been ported to Kotlin. As there&#x27;s not much call for this.<p>Unfortunately, I can&#x27;t recommend a book for non-Java developers as I don&#x27;t know any Kotlin developers who weren&#x27;t Java developers first!
chatmasta超过 7 年前
I asked a very similar question last week, you might be interested in the responses: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=16281374" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=16281374</a>
k120超过 7 年前
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超过 7 年前
What language are you coming from?<p>Kotlin is a modern language comparable to swift, rust, Scala or ocaml. Learning it is workthile as you’ll learn modern language concepts.
评论 #16335950 未加载
jimnotgym超过 7 年前
Glad to hear it&#x27;s not just me. I am considering just learning Java for Android for exactly this reason