Popular

How to Kotlin - from the Lead Kotlin Language Designer (Google I/O '18)

Published on May 10, 2018 141,784 views

Kotlin is similar to the Java programming language, so it's natural that your Kotlin code looks very much like Java code when you are first start to use the language. While this is fine to begin with, you're probably not taking full advantage of all the language benefits. In this session, the lead Kotlin language designer will show you how you can write more idiomatic Kotlin, what the benefits are, and help you discover some of the most powerful yet lesser known features of Kotlin.

Rate this session by signing-in on the I/O website here → https://goo.gl/rcxeHQ

Watch more Android sessions from I/O '18 here → https://goo.gl/R9L42F
See all the sessions from Google I/O '18 here → https://goo.gl/q1Tr8x

Subscribe to the Android Developers channel → http://goo.gl/GEh1ds

#io18

Comments
  • Igor Ganapolsky
    Igor Ganapolsky Год назад A class can be created with a single line of code, without getter/setter garbage. I love it!
  • Paris qian sen
    Paris qian sen Год назад Kotlin seems to take the best syntax suger from C# & JavaScript to Java world, which Java failed to provide for years. I am impressed.
  • Arron Bates
    Arron Bates 1 месяц назад @Chuk Prav ...Java the language is late, Java the JVM is still the wonder drug that it always has been. Java is dead, long live Java.
  • Chuk Prav
    Chuk Prav 7 месяцев назад You're so right. Java is so late.
  • Dave Thomas
    Dave Thomas Год назад Poor Andrey, he seems so nervous! Mind you I would be too lol. Great language he created. Many thanks from me, it has made my Android development fun where I have used it. Keep the good stuff coming with Kotlin!
  • Edin Omeragic
    Edin Omeragic 6 месяцев назад I've almost given up on android development then I've tried kotlin and it was fun.
  • Vachagan Balayan
    Vachagan Balayan Год назад he is not :)
  • christian janker
    christian janker Год назад He is doing great!!
  • Willmakk
    Willmakk Год назад modafinil intensifies
  • Igor Ganapolsky
    Igor Ganapolsky Год назад Yes, and maybe he's just being authentic without putting on a facade (because he doesn't need to since he is the inventor).
  • M.A. Zaki
    M.A. Zaki Год назад It's a presentation in front of thousands and not just a small team. And maybe he didnt have rehearsal like Google's speakers.
  • And L
    And L 1 месяц назад i think i would say good bye to java after 10 years. i am very impressed.
  • Артём Z
    Артём Z 1 месяц назад Hello from Saint-Peterburg!) In this city Kotlin has been started!
  • Chris Carlos
    Chris Carlos Год назад I would love to start using Kotlin where I work.
  • Alex Huiculescu
    Alex Huiculescu 7 месяцев назад We just started and we love it. We love its syntactic sugar, extension functions, the getters and setters, and coroutines. No more AsyncThreads and runOnUiThread. I could go on
  • Owlish Art
    Owlish Art Год назад Kotlin is a general purpose language, not just Android. At work, we use it for backend web development
  • Radu Savutiu
    Radu Savutiu Год назад Igor Ganapolsky it's perfectly foreseeable Kotlin will die a slow death if Android apps are going the way of the dodo bird. 🐦
  • Igor Ganapolsky
    Igor Ganapolsky Год назад (изменено) You should definitely start (perhaps start with unit tests in Kotlin). You will be thankful several years from now for learning Kotlin, trust me.
  • Radu Savutiu
    Radu Savutiu Год назад Why? Weren't you using Java annotations, boilerplate generators, and so on? Butterknife?
  • François Legrand
    François Legrand Год назад then use it
  • Tony Stark
    Tony Stark 2 недели назад More than the language, I like this person. He is so humble and down to earth. Great mind.. humble human being!
  • eatthepi
    eatthepi Год назад That trick when he showed Kotlin byte code then decompiled to Java was pretty cool. A few months back I was a little confused about what the 'noinline' keyword was doing... this trick would have probably made it clear.
  • OwnLine
    OwnLine 6 месяцев назад Timestamp?
  • Sieński Witold
    Sieński Witold Год назад Many reasons to switch to Kotlin :) !
  • Jiancan Chen
    Jiancan Chen Год назад pythonic! great
  • Wu Jacob
    Wu Jacob 11 месяцев назад Great job, master piece. Is the code in the demo available for download anywhere?
  • Colson Xu
    Colson Xu Неделю назад Me everyday learning Java: There has to be a better way
  • Hazarth
    Hazarth 3 месяца назад 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
  • Samuel Grahame
    Samuel Grahame 1 месяц назад Yeah I hate the name type order. Reminds be of visual basic
  • Qoini Official
    Qoini Official 1 месяц назад Did we really need 'fun'?
  • نارم Narm
    نارم Narm 1 месяц назад No
  • wesos de queso
    wesos de queso 1 месяц назад 😡 no fun 😡
  • TwistenTiger
    TwistenTiger 2 месяца назад 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
  • tim boyd
    tim boyd 2 недели назад Business didnt go as well as expected with oracle, so yeah kotlin is better than java
  • code_report
    code_report 10 месяцев назад (изменено) At 22:14, "this is something pretty unfamiliar for the C-language family" ... that is true pre-C++11. But with C++11, there are lambdas and immediately invoked lamba expressions (IILE), so you could write very similar code as follows: auto s = []() { if (condition) { cout << "Yay!\n"; return "Luck!"; } else { return "Not this time"; } } ();
  • Иван Дягилев
    Иван Дягилев Год назад Kotlin looks like Swift sometimes for me.
  • Rahul Abhishek
    Rahul Abhishek 4 месяца назад Yes. More than 70% similar syntaxes
  • breaddestroyer
    breaddestroyer 6 месяцев назад Chad Russell or still new
  • breaddestroyer
    breaddestroyer 6 месяцев назад Chad Russell how? Its fast as heck and very safe. And new, too.
  • Chad Russell
    Chad Russell 10 месяцев назад Swift is garbage.
  • Pál Varga
    Pál Varga 10 месяцев назад I have no EXP in scala, but according to your comment you do. So lemme ask a question. I belive Java is a bit outdated langauge, my original tought was that C# will eventually take over Java's throne, but now seeing Kotlin I kinda changed my mind. However when you said that is almost 100% Scala I ahve my doubts, since up until recently I have not even heard of Scala. So someone liek you who have seen all of these languages do you think Kotlin has a shot taking over java ? I belive Java will decline in the near future eventually.
  • Areeb Jamal
    Areeb Jamal Год назад Sobanya nope
  • Sobanya
    Sobanya Год назад It is actually almost 100% Scala, which also influenced Swift
  • Areeb Jamal
    Areeb Jamal Год назад They are very similar and for a good reason
  • Pulkit Kumar
    Pulkit Kumar 1 месяц назад Whenever he said, do you have questions? I always had one, and I remember he is in my phone not live :P
  • Liran Barsisa
    Liran Barsisa Год назад (изменено) Some comments: 13:13 The property won't allow you to use a different separator though, right? 23:32 The number "3" isn't even... 24:07 This "println" print "null" in case you give it null value. Any way to avoid this in a short way, and print only if it's not null? 26:34 Any way to convert to normal code instead of lambda? Sometimes it's clearer and seem more flexible...
  • Justin Quihuis
    Justin Quihuis 7 месяцев назад Continue using Java everyone else will move on and benefit from Kotlin. You are the same person from last year who thinks constant null checks are a benefit.