Dart 3 Class Modifiers Is kinda Confusing

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 พ.ค. 2023
  • Struggled a bit to understand Dart 3 Class modifiers. Let's learn about them and use them.
    Flutter Course: robertbrunhage.com
    Want to support me?
    ♥ Patreon: / robertbrunhage
    ♥ BuyMeACoffee: buymeacoffee.com/robertbrunhage
    ♥ Paypal: paypal.me/robertbrunhage
    ····················································································
    You can find me on:
    ● Website: robertbrunhage.com
    ● Twitter: / robertbrunhage
    ● Join our community: / discord
    ····················································································
    😎 Subscribe: bit.ly/2SUyRhx

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

  • @icodeyoutodeath
    @icodeyoutodeath ปีที่แล้ว +16

    This `abstract interface class` to say `interface` is such a weird thing. Wish we'd just call it an `interface` as in other languages.

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

      Haha, please don't remind me

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

      Yeah it's kind of verbose. Abstract classes are supposed to sort of work like interfaces and now we have this interface keyword which is basically just a class level visibility/accessibility modifier. I don't know, I suppose it's because we're working with class based programming/OOP rather than procedural or imperative. It's strange, the records and the pattern matching features were implemented in a way that's very thoughtful but these were kind of haphazard in my opinion. On the other hand, darts version of OOP is pretty straightforward so it's not a big deal, just really don't see myself using any of these keywords apart from mixin and final. Maybe though this will open the door for other modifiers like immutable or case class.

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

    Yes, please, highlight the new features of the Dart and Flutter, would be interesting

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

    always love how you explain things into simple ways. thanks for the video

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

    Thanks for the video. I am curious to know how you use debug point with that editor.

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

      I haven't used the debugger like that for more than 2 years so in short, I don't.
      If I want to, I just use the debugger that comes with the flutter devtools

  • @alexmercerind
    @alexmercerind 24 วันที่ผ่านมา +1

    I'm only studying these for interview. Sealed classes are fine, but others are just overkill now imo.

    • @RobertBrunhage
      @RobertBrunhage  24 วันที่ผ่านมา

      Between all of these modifiers I using sealed classes 99% of the time

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

    Let's goooo!!!

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

    May i ask if coding in command line is any better of vscode (especially you have alot of keymaps customization or vim extension) ?

    • @RobertBrunhage
      @RobertBrunhage  ปีที่แล้ว +4

      I guess for me, the defining factor are these for using NeoVim in the terminal:
      - More fun
      - Learning more about terminal usage/commands
      - Just feels more snappy
      So no, you will do completely fine on a normal editor. I just wanted to learn it, and then got stuck/loved it

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

    Great!!!

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

    you cannot instantiate interface. Interface are implementation-less definition of an object (its methods, its interface).
    I do like this short video, good summary.
    I would suggest to explain the 101 concept of OO and how it was implemented in flutter as well, maybe for another video :)

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

    I come from Swift.
    I find all of this very confusing. What's the difference between a mixin and an interface?
    Even the dart documentation blurs the lines for me 😅

  • @1234matthewjohnson
    @1234matthewjohnson ปีที่แล้ว +2

    plz more

  • @RAFAELAGUIAR-nt3lt
    @RAFAELAGUIAR-nt3lt ปีที่แล้ว +2

    It's cool, but I'm worried about all the bad code that this will generate, broken SOLID principles and so on. I still prefer to work with class.

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

    interface is an interface. I am not sure why talking about extends etc. It is a common concept in all languages providing OO

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

      Dart doesn't have normal interfaces as classes has implicit interfaces.
      The way we create interfaces before was just defining classes that we couldn't instantiate, which still has the problem that the class could be inherited from.
      Using the interface keyword makes it so the class is only being able to implement as an "interface".
      Such a pain, but it is what it is.

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

    `abstract interface class` ??? really? wth

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

      abstract interface base sealed class

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

      @@RobertBrunhage "Stop it, Patrick! You're Scaring Him!"

  • @1234matthewjohnson
    @1234matthewjohnson ปีที่แล้ว +1

    yew

  • @cristianproust
    @cristianproust 7 หลายเดือนก่อน

    You pronounce can and can't almost the same. It becomes confusing

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

    You I didn't want this at all this just Java but worse atleast in Java you just do interface but now we say abstract interface class 🤮
    Edit: base classes and sealed classes are good enough though

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

      Switch to java then

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

      @@Abdurrahman98XX 😂😂 that's a fantastic response lol. But I can just ignore interfaces and just use abstract classes as I am used to.

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

    I think Dart SDK, the technical implementation is good, but my god Dart is such a badly designed language

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

    what a terrible explanation