如何使用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.