Code Review: Dart

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 พ.ย. 2024

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

  • @ryangrogan6839
    @ryangrogan6839 ปีที่แล้ว +63

    I absolutely love Dart and Flutter. Dart is still having growing pains when it comes to back end, but it is insanely performant on native (desktop and mobile) compared to JS frameworks. Dart is very strongly typed like c#.

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

      Agreed, I put Dart up there with the likes of C# and Kotlin in terms of what it is capable of. I just wish people that put so much effort into ecosystems like JS and Java would instead prop up languages like these.

    • @s.bamahfoodh
      @s.bamahfoodh 7 หลายเดือนก่อน

      No no let them thrash it so our salaries remain high lol

  • @JLarky
    @JLarky ปีที่แล้ว +105

    Dart is Google's attempts to do typescript, but instead of a linter it's a whole language (that you can compile to different targets than just browser)

    • @AndiRadyKurniawan
      @AndiRadyKurniawan ปีที่แล้ว +20

      Just to point out that it came before typescript. I was surprised it lived this long. 😂

    • @paulerickson5116
      @paulerickson5116 ปีที่แล้ว +21

      Dart is code once run anywhere so consolidated code to hit 5 platforms
      Dart is backend feasible as well

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

      The Dart PR is more complete and pulls in more 3.0 rich

    • @dealloc
      @dealloc ปีที่แล้ว +11

      Dart was created to complement (replace) _JavaScript_ initially. They released a Dart-native browser called Dartium. It quickly died out. Then Flow, TypeScript etc. evolved. After a long while Dart was repurposed for Flutter.

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

      It came before Typescript. It was intended as an alternative to Javascript having native browser support as well, didn't turn out that way.

  • @jeroen1473
    @jeroen1473 ปีที่แล้ว +68

    Dart has wayyyyy stronger type safety compared to Typescript. It feels more like if a language like C# had a baby with Typescript than Typescript. Also the Flutter ecosystem is kinda big and Dart just released compilation to webassembly so I can see it going places.

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

      It's great that they fixed it. Dart initially was awful and had no null safety.

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

      How to enable wasm?

  • @leosconflicts
    @leosconflicts ปีที่แล้ว +49

    You can use flutter not only for mobile applications, but for web and desktop apps as well. It feels weird to hear "you're going to learn a language and then only use it to one thing" .... but at the same time people complain that you can use JS for everything.

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

      The fact that JS can be used for everything isn't the complaint, it's the fact that it's not the best language for all those other use cases. Python would be a more suitable choice, but honestly, I'd rather we ditch interpreted languages altogether; we're at a point where modern compiled languages are just as easy to work with and come with better performance out of the box. Dart, Kotlin, Go, and modern C# are becoming more compelling to work with.

  • @kyuss789
    @kyuss789 ปีที่แล้ว +21

    This example also didn’t showcase any of the cool stuff dart has built it. Sound null safety, extensions, streams, isolates, pattern matching. And meta programming is coming which would be like Zig comptime
    That said you are 100% right it’s deep and it’s not really used outside of flutter so the investment to learn isn’t great if you aren’t bullish on flutter. You can write servers and cli tools but every lang can do that. The biggest advantage it has over TS is its tooling, shit just works and you don’t have the baggage of JS. It’s a pretty cool language but if flutter didn’t exist you wouldn’t even know about it

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

      Dart debugging and devtools are great. Works really well

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

    That summary of dart was pretty painful to listen to. Yes flutter is it's killer app but you can write anything you want in it. It's actually a very nice language with a lot of really nice features and they continue to add to it which is great. With dart 3 they just added pattern matching, and records (tuples). You've got real null safety, a fantastic implementation of async via futures and streams, concurrency and parallelization via isolates, code generation via reflection, etc. It's also got FFIs for c, Java, kotlin, JavaScript, Swift, objective c, etc. It's a really fast language for a GCed language and to be honest I wouldn't be surprised if it becomes more and more popular outside of flutter in the near future. I think of it like a better version of C# with features from languages like kotlin, smalltalk, JavaScript and Erlang.
    Probably the most painful thing about dart, is that it was a candidate to replace JavaScript and yet the JavaScript community rejected it. We would be so much better off if the dart virtual machine was in every browser instead of these terrible JS engines.

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

    We wrote an app with flutter, and we reused a library we wrote in a dart backend service to also work with google home/alexa. Worked pretty well, but also was low traffic. I think you can natively compile it to a lot of platforms, which is nice.

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

      It compiles to machine code everywhere except for web where it’s jvm bytecode

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

      @@paulerickson5116yeah, I think the original plan was to compile directly to WebAssembly, but it seemed a bit ambitious, so they scratched it for the time being.
      Hope they revisit it in the future though, could be huge.

  • @pandaDotDragon
    @pandaDotDragon 5 หลายเดือนก่อน +3

    Dart is the answer for people like me that don't want to touch to Javascript/Typescript even from far with a stick.
    And I really appreciate how it's designed (vs. C++, Java, Python).

  • @rushtothemax76
    @rushtothemax76 ปีที่แล้ว +10

    Man dart is a language that i love and its sad too see that it only gets used for flutter

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

    Believe it or not but Dart had a browser at one point called Dartium, which was a modified Chromium to support Dart natively for, I guess debugging purposes.
    Their idea was that Dart was going to complement (rather, take over) JavaScript, because it was at one of those times where people were hating on JavaScript before it became cool again-these cycles happens every few years or so. Dart was thrown under the bus for a while until Flutter came along.

    • @Hector-bj3ls
      @Hector-bj3ls 6 หลายเดือนก่อน

      It was a proof of concept to show you could have the two VMs in the same browser.

  • @paulerickson5116
    @paulerickson5116 ปีที่แล้ว +13

    Dart linter heavily suggests immutable qualifiers final or const

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

    I've played around with Flutter a little bit and Dart is a neat little language.

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

    final you can’t reassign but is mutable, feels the same as JS const. But const is immutable all the way down. Meaning nothing inside can change also if you are assigning an instance of something it must have a const constructor (like on the enum) This gives some performance wins at runtime for example in flutter it doesn’t have to evaluate the tree past a const widget because it can not change

  • @s3rit661
    @s3rit661 9 หลายเดือนก่อน +2

    I love dart, is the exact same syntax of Java but with steroids (null safety, memory safety, type safety, it has a type resolver inside)

  • @flyte9844
    @flyte9844 ปีที่แล้ว +10

    I really like dart , my favorite language to date

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

    Think of flutter as having a cross platform UI library which compiles natively to all the 5 platforms built on spirv pipeline and initially based on skia. Its by far the best developer experience I had writing native app and cross compiled UI interfere. There is simply no better alternative for it. Want to modify how your window launches up in linux and windows separately, use the native stack for the platform.

  • @parsanasirimehr7267
    @parsanasirimehr7267 ปีที่แล้ว +11

    Do Swift next. I think you will like the language, even if it is useless out of Apple environments

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

    You can do - Android, iOS, Windows, Linux, MacOS, Web and also Backend with Dart. Ignorance is bliss.That's how your average JS developers are.

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

    Did he just merge a PR without even looking at the diff. That is mental lol.

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

    There is a better way to do a lot of this now with the latest version of Dart. Want a PR?

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

      Source: was on Dart/Flutter team at Google

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

    It bugs me that the person doing the implementation didn't opt for the new pattern matching switch expression. Like the impl depends on dart sdk version ^3.0.0. Why?

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

      Please make a merge request!

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

      I updated it man sorry

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

      There are many other ways to make this code look better.

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

      @@adriankal like ?

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

    Dart is cool, but it's missing key features like static metaprogramming. You'll get why this sucks if you code in Dart with Flutter for a while and stuck using code generators (yikes).

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

    Feels like java, but that Alphabet will sue you instead of Oracle

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

    two incredibly likable people

    • @Ring0--
      @Ring0-- ปีที่แล้ว

      What? T.J. seems un-natural.

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

    I may have just copied the ts code super fast so that I can be first 😀. I now made some changes and used the new pattern matching syntax and removed the shitty ch = \0 constructor thing it was unintended.

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

    I'm loving these code reviews. Great little look at different languages. Keep up the great content 👍

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

    Guys, what plugin is used to display nesting hierarchy at the top of the screen?

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

    This series has been so fun!

  • @joranmulderij
    @joranmulderij 3 หลายเดือนก่อน

    Dart with pattern matching is great

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

    Nothing like a super sexy pure functional Kotlin Mobile Multiplatform :D

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

      Youre right. It works 🤣

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

      But you still need to code in kotlin for android UI and swift for swiftui where as flutter it's one codebase everywhere

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

      @@hamzakhiar3636 Actually no, i think Compose multiplatform allow you to write UI in Kotlin for Swift too

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

    Javascript always gets shat on for "immutable" not being immutable in the case of lists and objects, but it's literally the same in every mainstream language.

  • @intuneknight9681
    @intuneknight9681 5 หลายเดือนก่อน +1

    Dart is very good at backend way better that nodejs, it is a language no some invention of include javascript into some kind of framework shit, you can do API, manipulate OS resources flutter is jut the Front End framework and to be honest I try to go into C# dart and flutter is super fast to build simple apps in no time, I never has to build complicated stuff but for my own tools is really amazing and fast you can create apps and no stupid ones really good front end, and forget writting CSS HTML AND JS just pure DART and you get the job done the widgets in flutter are awesome.

  • @g.v.m7935
    @g.v.m7935 4 หลายเดือนก่อน

    I'm a bit of a noob still but isnt dart usecase having one codebase good ui performance against for example blazor or blazor maui hybrid? One codebase and crossplatoform out of the box is pretty nice and handy for building a quick and dirty app, this seems to make it possible while beeing descently efficient and performing acceptable right?

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

    I firstly found the Dart a pretty weird language :( Then when coding apps in Flutter realised all Dart lang features were suposed to be used inside Flutter letting the development more easy :O

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

    Dart feels a lot like typescript or java to write, except for the formatter. It's so heavily opinionated (so that "all flutter should look the same") that it can make code completely unreadable. I've written some sizable apps with Flutter hand having these huge nested Constructors only indented with 2 spaces makes it incredibly difficult to work with. I was fighting the formatter half the time because there needed to be 2 pixels of offset on some textbox.
    About the backend comment: I'm pretty sure you could if you wanted to...

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

      Set line length to 1000 and write commas everywhere. Code looks very nice after that.

    • @BooleanDev
      @BooleanDev 11 หลายเดือนก่อน +1

      use the trailing comma lint and enable fix/format on save, makes life much better

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

    Hash code was to uniqify by value

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

    Abstract interface class🤙

  • @maometos
    @maometos 9 หลายเดือนก่อน +1

    Dart is a general-purpose language that has a syntax very similar to Java but better because it has modern features like extension methods and async programming..., and can compile to native assembly applications using the Jit compiler or Aot compiler.
    javascript or typescript are not much for Dart because they are limited only to the browser.

  • @pavloburyanov5842
    @pavloburyanov5842 4 หลายเดือนก่อน

    Dart actually pretty nice looking language. But I won't gonna learn it anyway)

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

    Alright listen. The front end needs its own damn language. Flutter is indeed the main reason for Dart. Don't use it on the back end. That's dumb. Pair it with your favorite back end language and put together a nice API to connect into all the libraries you need in other languages and let Flutter handle the annoying type systems that you normally have to write yourself in Typescript. All your styles are right there in the widget classes themselves. Yes, I know it's annoying that they call them widgets, but the widget tree is a beautiful construct that makes visual builders like FlutterFlow waaay easier to put together. If you're coding Flutter raw, you're not fully taking advantage of the framework's capabilities.

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

    I can't like the video, it has 420 nice likes

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

    Flutter nothing but Magic

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

    Damn I'm waiting for all

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

    Hmm… judging by the comments people do really like the language. Personally I’m not sure what Dart brings to the table at this point. It feels like a new language for the sake of a new language.

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

      I mean that's a valid point, I think has to do with the use case it was targeting. Dart has been around for over 10 years, it just failed to replace JS, so it was repurposed for working on mobile and desktop apps because of these traits: great DX, OOP principles (which many JS devs hate for no reason, and it's the best way to represent UIs), productivity and readability, and high performance with JIT (for hot reload) and AOT (for production) compilation. Sure, these traits can be found in other languages, but I think in some aspects, Dart scores better than most languages, specifically DX and productivity.

  • @puspo-in
    @puspo-in ปีที่แล้ว +2

    erlang ftw

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

    Rust is also a language for doing very specific things so I'm not sure what you're talking about.
    Mobile development got 10x easier thanks to dart.
    React Native is laughably bad on mobile, Native is unnecessary hard. On ios because apple doesn't care about developer experience, on Android because it's based on Java.
    Additionaly there is server pod which is the only solution for realtime apps. Even firebase doesn't provide such features.
    Lang is solid and boring, but has nice packages by community that makes it really better than other lang. Freezed, riverpod, dartz etc.
    The main selling point is hot reload. Just save any file and UI just refreshes. No other technology has that.
    Really not much to complain

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

    fart/10

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

    Abstract interface class🤙