Why null safety? | Session

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 พ.ค. 2021
  • Hear from one of Null Safety's creators about how this fundamental new language feature impacts the experience of writing Dart code, prevents errors, and results in smaller, faster binaries.
    Resources:
    Null Safety in Dart → goo.gle/3vwR48B
    Understanding null safety → goo.gle/3gLsVa1
    Why Nullable Types? → goo.gle/3u3vJ67
    Speaker(s): Bob Nystrom
    Watch more:
    Flutter at Google I/O 2021 Playlist → goo.gle/io21-Flutter
    All Google I/O 2021 Technical Sessions → goo.gle/io21-technicalsessions
    All Google I/O 2021 Sessions → goo.gle/io21-allsessions
    Subscribe to Flutter! → goo.gle/FlutterYT
    #GoogleIO #Flutter
    product: Flutter - General; event: Google I/O 2021; fullname: Bob Nystrom; re_ty: Premiere;
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 75

  • @jdheeter
    @jdheeter 3 ปีที่แล้ว +99

    This man is great at explaining things

    • @thebirdhasbeencharged
      @thebirdhasbeencharged 3 ปีที่แล้ว +9

      You should read his books (Crafting Interpreters and Game Programming Patterns), walking wizard!

    • @philosophia5577
      @philosophia5577 ปีที่แล้ว

      I felt the same entire time. This video gave me a lot of topics to explore after which I will rewatch this video for greater understanding.

  • @StanislausMadueke
    @StanislausMadueke 3 ปีที่แล้ว +71

    This is definitely my current favourite IO talk - just the right level of detail for such a complex topic. Great job, Bob! Hope to see more from you in future.
    ♥️ Dart and Flutter!

    • @awsumgeorge
      @awsumgeorge 3 ปีที่แล้ว +3

      +1; The speaker's profile badge is quite misleading, though. Bob does not look anything like that picture nowadays, and the chihuahua passed away since the picture was taken. (Check out Bob's books, btw. Good stuff; approachable and informative.)

    • @nicolalanzoni674
      @nicolalanzoni674 3 ปีที่แล้ว

      @@awsumgeorge Hey Jiri, what's the name of Bob's are you referring to? I'd like to take a look. Thanks

    • @awsumgeorge
      @awsumgeorge 3 ปีที่แล้ว +2

      @@nicolalanzoni674 They are "Game Programming Patterns" and "Crafting Interpreters". Both available to read for free at the book's websites.

  • @huthaifa5
    @huthaifa5 3 ปีที่แล้ว +23

    When I listen to Bob Nystrom talk about Dart and Null Safety, it feels like listening to poetry. Not even sorry for how geeky that sounds. Amazing work guys, always happy for the constant improvements and changes you keep providing.

  • @SundiMyint
    @SundiMyint 3 ปีที่แล้ว +6

    I have seriously never consumed more articulate code content on the internet. Thank you all for your hard work and putting time into making this content for us!

  • @pauek
    @pauek 3 ปีที่แล้ว +3

    I love that you decided to publicly talk about the complex decisions that went into implementing null safety, and not water it down. Thanks so much!!
    This can only strengthen our confidence in and attachment to Dart and Flutter.

  • @LohenYumnam
    @LohenYumnam 3 ปีที่แล้ว +14

    Coming from Swift .. I love null safety.. awesome job guys ❤️❤️

    • @krishnateja4688
      @krishnateja4688 3 ปีที่แล้ว

      really ? the persons who came from swift won't like this cause this doesn't has if let or guard, which is crucial for type promotion.

    • @LohenYumnam
      @LohenYumnam 3 ปีที่แล้ว +1

      ​@@krishnateja4688 ya that part I miss a lot. I miss the power of enum, in swift too. Dart is not perfect but they are trying. It’s funny that if (x != null ) is the alternative of guard let or if let

    • @user-xm2yz5yy6l
      @user-xm2yz5yy6l 3 ปีที่แล้ว +1

      @@krishnateja4688 Came from swift too. its just a litter bit more code . i will take it.

  • @azrulihsan4085
    @azrulihsan4085 3 ปีที่แล้ว

    Such a relief with null-safety features in dart. Been migrating my old projects and it felt like a heavy burden lifted from my head. Good job flutter team!

  • @roger58469
    @roger58469 3 ปีที่แล้ว +1

    This was really great to watch, an excellent explanation. Thank you very much for the video and kudos to Bob Nystrom!

  • @samgamer3530
    @samgamer3530 3 ปีที่แล้ว +1

    Terrific presentation -- Bob, you are killing it

  • @dovas90
    @dovas90 3 ปีที่แล้ว +1

    Great description and explanation! Thanks for the help. I love your team!

  • @huxpresso
    @huxpresso 3 ปีที่แล้ว +1

    I don't use Dart but I studied PL in school so I love the balance between being pedantic and being pragmatic during this talk ❤️ Definitely the best programming talk this IO so far!

  • @nordern1
    @nordern1 3 ปีที่แล้ว +14

    TIL: We use C because Pascal had static array sizes :P

  • @jainam9805
    @jainam9805 3 ปีที่แล้ว +9

    i don't comment publicly often but damn this guy busted my brain with knowledge of language designing!
    Please start your own channel and disperse knowledge of dart

  • @MichaelDuarte
    @MichaelDuarte 3 ปีที่แล้ว +1

    This is awesome, thanks for the super easy to understand explanation of how this works and most importantly, why!

  • @osamaali6603
    @osamaali6603 3 ปีที่แล้ว +2

    Wow! This was an amazing talk. Poetic!

  • @peterhuijsen
    @peterhuijsen 3 ปีที่แล้ว +1

    Really well explained! Loved the talk.

  • @Yous0147
    @Yous0147 3 ปีที่แล้ว +1

    Amazing video, great overview and very insightful discussion. Really enjoyed every minute.

  • @muneebmukhthar4880
    @muneebmukhthar4880 3 ปีที่แล้ว +1

    Best I/O talk !

  • @dantedt3931
    @dantedt3931 2 ปีที่แล้ว

    Great explanation. Flutter is the future!

  • @nicoeg
    @nicoeg 3 ปีที่แล้ว +1

    Such a good explanation and really good talk!

  • @Pablo_IF
    @Pablo_IF 3 ปีที่แล้ว +1

    Great video!! Many thanks!!

  • @amitmohan7594
    @amitmohan7594 3 ปีที่แล้ว +1

    Awesome talk!

  • @SaiyanJin85
    @SaiyanJin85 2 ปีที่แล้ว

    That was great! It makes me think about my code in other languages.

  • @Neoclassicalmaese
    @Neoclassicalmaese 2 ปีที่แล้ว

    This man claims in his books Crafting Interpreters that language designers are no dark arcane wizards. But he cannot fool me, is IS a dark arcane wizard. Thank you Bob for sharing your knowledge with the world!

  • @SethuSenthil
    @SethuSenthil 3 ปีที่แล้ว +12

    I always wondered how the Dart engine checks null, this is crazy

  • @sthiag0
    @sthiag0 2 ปีที่แล้ว

    Wow. What a great great talk.

  • @kousheralam
    @kousheralam 3 ปีที่แล้ว +1

    Nicely explain, love it 🤩

  • @sohelakhtar8044
    @sohelakhtar8044 3 ปีที่แล้ว +6

    Great talk❤️🇳🇵

  • @bibitepower
    @bibitepower 3 ปีที่แล้ว

    Null Safety is awesome, you did a great job! 💪
    I think we're all waiting for type unions and data class 😉

  • @idlevandal69
    @idlevandal69 3 ปีที่แล้ว +1

    Great job!!!!!

  • @demondragon6198
    @demondragon6198 3 ปีที่แล้ว +1

    it's informative !!

  • @evandrojunior7628
    @evandrojunior7628 3 ปีที่แล้ว +1

    Amazing!

  • @richardjay1791
    @richardjay1791 2 ปีที่แล้ว

    Sweet. Thanks

  • @aminelahrim8142
    @aminelahrim8142 3 ปีที่แล้ว +1

    Thank you for the informations I like null safety

  • @_chappie_
    @_chappie_ 2 ปีที่แล้ว

    Interesting. I've always thought the idea was to eliminate null values all together, unless absolutely necessary. Thanks for the insight.

  • @jrheisler
    @jrheisler 3 ปีที่แล้ว +3

    Flutter Web app, just migrated to null safety, it is noticeably faster, and the migration tool!!! Well done!

  • @krokenstiv8777
    @krokenstiv8777 3 ปีที่แล้ว

    Supporting both dynamic and static typing is a very smart decision. Also I like that I can use Future as a coroutine or as a promise depending on the problem. But nullsafety is not important for me.

  • @tananga1523
    @tananga1523 3 ปีที่แล้ว +2

    Love this videos ! Can you guys add support for Dart in Cloud Functions ? Is a shame to use node or python. That will be legendary !!!

  • @baraaaljabban9058
    @baraaaljabban9058 3 ปีที่แล้ว +1

    I read a lot of comments say : great talk (and really it is), but I don't know why I fell it's too heavy or it's so hard for me to understand it easily 😂
    I'll get back to it agin to understand more. Anyway thank you for the explanation ❤️

  • @agung_laksana
    @agung_laksana 3 ปีที่แล้ว +1

    Please provide optional casting ( as? ) like in Swift and Kotlin

  • @danielbarnett5764
    @danielbarnett5764 3 ปีที่แล้ว

    Had to like this video. :-)
    Im new to Flutter/ Dart but is there an "undefined" value rather than null. I.e. not set vs actually null. Detecting something never set is a useful conditional test. Seems relevant to the example. Cheers great vid

  • @ruynobrega6918
    @ruynobrega6918 3 ปีที่แล้ว

    One of the things that made me use less python was the dynamic type check/null check. It REALLY slows down apps. Typed languages are the best to read and write, and null safety improves both readability and performance. To be honest, I don't think there is any drawback here at all.

  • @Kitulous
    @Kitulous 2 หลายเดือนก่อน

    7:50 coudn't the outside code update the list? like in the first isNotEmpty call it had no elements, therefore border didn't get initialized, then some other code in between the two ifs added an element in there, and the second isNotEmpty succeeded, and we got an uninitialized border variable.
    List can be mutable, it's not some sort of read-only list.

  • @dc5
    @dc5 3 ปีที่แล้ว +5

    What a great talk! Thank you, Bob! About fields and top-level having to use the bang...
    I still find it a little odd and not sure if it's good practice or not to do it that way. For example, that screen at 14:38 looks scary
    ... if (_positional != null) rules.add(_positional!);
    I have many of those around and just feels odd. So I wanted to know your opinion on whether that's ok or if there is a better, recommended way of handling those?

    • @pierre-louisguidez2040
      @pierre-louisguidez2040 3 ปีที่แล้ว +2

      This is expected for fields. The explanation and an alternative to using ! (copying to a local variable) are explained at dart.dev/null-safety/understanding-null-safety#working-with-nullable-fields

    • @dc5
      @dc5 3 ปีที่แล้ว +1

      @@pierre-louisguidez2040 thank you, that's what I've been doing... A mix of bangs and local variables.. just wanted to confirm it was good practice.. thank you!

  • @ChrisC97232
    @ChrisC97232 3 ปีที่แล้ว

    I didn’t really understand a thing, but watching and listening to this guy, I was made to feel as if I mastered what null safety is from even the start of the video 😅 This dude is a master at presenting 🙌🏾

  • @CleisonArenhart
    @CleisonArenhart ปีที่แล้ว

    It can be pretty painful migrate an old codebase to null-safety. I ran "dart migrate" and i've noticed that our code is not prepared for that. A lot of usages of maps as indexes which needs "!" operator, a lot of variables that needs to be late and the migration didn't recognize it, so made it as nullable ("?" operator). Now I'm looking for 466 files to check which one is right and which one is not. Basically, I'm re-doing everything. At least, de migration marked-up which file I have to look.

  • @siyabon_ga
    @siyabon_ga 3 ปีที่แล้ว

    Bob needs to explain all flutter/dart confusion related topics coz green light all of a sudden on my side.

  • @adamcierniak3902
    @adamcierniak3902 3 ปีที่แล้ว

    How to disasembly flutter program ? I mean how to extract lower levels of abstractions from dart to assembler?

  • @akhileshsuvarna8830
    @akhileshsuvarna8830 3 ปีที่แล้ว

    💙 from INDIA

  • @harry356
    @harry356 2 ปีที่แล้ว

    Instead of a null error I just get unexpected behavior that takes a while to debug. If i get a nullpointer I immediately know what is wrong and where to fix it. Maybe I need to get used to it?

  • @mobileappsdevware264
    @mobileappsdevware264 3 ปีที่แล้ว

    Hi man, i start to learn dart and flutter, i wonder why object in in flutter can't be mirrored or reflected, i need to list an object properties , in other words i need to make some thing like GSON Lib (android) and JsonDecoder(iOS). can we?!

  • @xXxBladeStormxXx
    @xXxBladeStormxXx 3 ปีที่แล้ว +2

    But what about null safety in Lox, Bob?

    • @m00ni
      @m00ni 3 ปีที่แล้ว

      :D

  • @obengkuning3260
    @obengkuning3260 3 ปีที่แล้ว

    Why?

  • @Shakl-e
    @Shakl-e 3 ปีที่แล้ว

    I am not afraid of null anymore

  • @justchecking2470
    @justchecking2470 3 ปีที่แล้ว

    and then suddenly all tutorials from old versions crashed

  • @danvilela
    @danvilela 3 ปีที่แล้ว +6

    300 IQ

    • @huthaifa5
      @huthaifa5 3 ปีที่แล้ว +2

      IQ overflow*.

  • @gokhangorali5385
    @gokhangorali5385 ปีที่แล้ว

    Electrons? detected :))

  • @mortysmith666
    @mortysmith666 3 ปีที่แล้ว

    After migrating to null safety, my app size became doubled

  • @francisgeorge7639
    @francisgeorge7639 3 ปีที่แล้ว

    Good presentation. But Google still need to be employing professional documentation writers and not engineers.

    • @m00ni
      @m00ni 3 ปีที่แล้ว

      We do have two very excellent tech writers on the team. But we hear from many users that they appreciate learning directly from the engineers who work on parts of the system. (Also, I am an author too, so I guess technically I fit your criteria.)

  • @MyrKnof
    @MyrKnof 11 หลายเดือนก่อน

    contrary to everyone else, I hate this so much. As someone who just got told to upgrade a 5 year old app its all just: late late late late late !!!!!!!!!!!!!!!!!!!!! ??????????????????? and hope it works afterwards. I got no idea what I'm doing or how to fix anything. Perhaps im just too dumb and lazy to be a programmer. Everything worked fine before.

  • @francisgeorge7639
    @francisgeorge7639 3 ปีที่แล้ว

    Delphi solved the Pascal string problem. It also had almost instant compile. And Oh my gosh it was so much simpler than Flutter. With Flutter we're almost back to 90% UI coding 10% business logic, which Delphi switched. Delphi died because Microsoft stole their lead developer, who went on to design c# and Typescript.

  • @coom07
    @coom07 3 ปีที่แล้ว +1

    Bruh. Can u keep talking in every google IO