如何使用Kotlin-来自首席Kotlin语言设计师(Google I / O' 18)



Kotlin与Java编程语言相似,因此,当您第一次开始使用Kotlin代码时,它自然很像Java代码。刚开始时这很好,但是您可能没有充分利用所有语言优势​​。在本节中,首席Kotlin语言设计师将向您展示如何编写更加惯用的Kotlin,其好处是什么,并帮助您发现Kotlin的一些最强大但鲜为人知的功能。

通过在I / O网站上登录→https://goo.gl/rcxeHQ对该会话进行评分

在此处观看来自I / O ’18的更多Android会话→https://goo.gl/R9L42F
在此处查看来自Google I / O ’18的所有会话→https://goo.gl/q1Tr8x

订阅Android开发者频道→http://goo.gl/GEh1ds

#io18。

40 comments
  1. Im Learning Kotlin to develop android apps to replace legacy code written to run in Telnet within our multivalued DB.
    The android apps will be used on RF Guns to control Stocks in a warehouse.

  2. English is a language which is derived from many languages
    and is the leading language in the world
    Kotlin language is also derived from many languages including Java
    I think it will soon be the best language

  3. 10:28 seems like not as great of an idea.. kinda reminds me of "don't use global in JavaScript", even tho I haven't touched js for like a decade.
    Like, for me it seems natural to encapsulate functions into groups based on what they are doing. Can't imagine trying to remember what exactly is the name of one of thousands functions in your project.
    While if they were in a class e.g. StringUtils, you can just write the class name, put a dot and scroll through the functions inside it, "oh that's the one I was looking for".

  4. Another programming language and from this presentation it does look better than existing JAVA. It takes a lot of time, effort and working experience to master a programming language, why can't these programming language inventors work together to perfect the existing programming languages instead of keep creating new .

  5. I just don't understand why there are so many software engineers writing kotlin code on Mac computers, am I the only one who notices this ?

  6. Can you just please keep the code on the screen all the time, next time? Maybe just have a speaker view contained in the nested screen…This way I had to stop video too many times.

  7. Kotlin is great… But to put my feet in the workplace, I must know Java first. Indeed, dice, glassdoor, wherever you look, Java still in huge demand due to its deep penetration and a decade long dominance in enterprise world.

    P.S. on next kotlin release, please change FUN with something else. That irrelevant word is annoying to many coders(if not all).

  8. I sorta know kotlin still learning tho si cant articulate likes and dislike too well yet. But idk if I want short dev time as a python and c c++ guy I'll just go with python I feel you need an ide with java and kotlin because there is so much overhead, extension functions are really nice tho

  9. 18:42 Is the function argument e on line 26 nullable? If so and I pass null on line 33 which is clause in the when statement would be true? Is sealed making it non-nullable?

  10. To anyone thinking they are used to Java and don't need to learn Kotlin or struggling, I say go for it learn it trust me all worth it don't think just do it

  11. Finally someone fixed Java and made it more C again with other great additions from languages like Python and C# and all that. There a are a few quirks I'm not particularly happy about, a lot of them come with the JVM baggage (like not being able to manage my own memory) and I don't understand why we had to switch to name:Type schema instead of "Type name" which I thought was always more natural to read like real text, but I can live with those

  12. Over-analyzing with developer paranoia :

    Google Big Boss – "How do we get developers to start writing apps for Fuscia with Flutter and Dart?

    Google Smaller Big Boss – "Introduce a new programming language to Android that's "better", but also "annoying"!

    Google Big Boss – "Do it."

Comments are closed.