Code Review: Dart

Поделиться
HTML-код
  • Опубликовано: 31 май 2023
  • LIVE ON TWITCH: / theprimeagen
    Check out Teej!:
    / @teej_dv
    / teej_dv
    Get in on Discord: / discord
    Get in on Twitter: / theprimeagen
    Got Something For Me to Read or Watch??:
    / theprimeagenreact
  • НаукаНаука

Комментарии • 73

  • @JLarky
    @JLarky Год назад +95

    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 Год назад +18

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

    • @paulerickson5116
      @paulerickson5116 Год назад +1

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

    • @dealloc
      @dealloc Год назад +10

      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.

  • @ryangrogan6839
    @ryangrogan6839 Год назад +44

    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 месяцев назад +7

      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 2 месяца назад

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

  • @leosconflicts
    @leosconflicts Год назад +44

    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 месяцев назад +8

      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.

  • @draakisback
    @draakisback Год назад +18

    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.

  • @jeroen1473
    @jeroen1473 Год назад +57

    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?

  • @kyuss789
    @kyuss789 Год назад +15

    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 Год назад +5

      Dart debugging and devtools are great. Works really well

  • @7orx
    @7orx Год назад +15

    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 11 месяцев назад

      @@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.

  • @dealloc
    @dealloc Год назад +11

    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 Месяц назад

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

  • @paulerickson5116
    @paulerickson5116 Год назад +10

    Dart linter heavily suggests immutable qualifiers final or const

  • @Im_Ninooo
    @Im_Ninooo Год назад +13

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

  • @rushtothemax76
    @rushtothemax76 Год назад +8

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

  • @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

  • @sids911
    @sids911 Год назад +5

    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.

  • @flyte9844
    @flyte9844 Год назад +8

    I really like dart , my favorite language to date

  • @parsanasirimehr7267
    @parsanasirimehr7267 Год назад +11

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

  • @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 ?

  • @Jason_Kang
    @Jason_Kang Год назад +1

    This series has been so fun!

  • @AnthonyBullard
    @AnthonyBullard Год назад +3

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

    • @AnthonyBullard
      @AnthonyBullard Год назад +3

      Source: was on Dart/Flutter team at Google

  • @s3rit661
    @s3rit661 5 месяцев назад +1

    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)

  • @blueice1364
    @blueice1364 Год назад +2

    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.

  • @VovaY
    @VovaY Год назад +1

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

  • @kash1222
    @kash1222 Год назад +2

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

  • @slowjocrow6451
    @slowjocrow6451 Год назад +3

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

  • @pandaDotDragon
    @pandaDotDragon 27 дней назад

    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).

  • @fuscitas
    @fuscitas Год назад +1

    if you say you can at leaste do everything with javascript you ignore, that you can do everything with dart as well. dart may not be perfekt but it actually has a decent enough typesystem and is compiled to an executable.

  • @jonforhan9196
    @jonforhan9196 Год назад +2

    two incredibly likable people

    • @Ring0--
      @Ring0-- Год назад

      What? T.J. seems un-natural.

  • @TechBuddy_
    @TechBuddy_ Год назад +9

    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.

  • @ac130kz
    @ac130kz Год назад +1

    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 Год назад

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

  • @Nojipiz
    @Nojipiz Год назад +1

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

    • @anon3118
      @anon3118 2 месяца назад

      Youre right. It works 🤣

  • @kubre
    @kubre Год назад

    Damn I'm waiting for all

  • @paulerickson5116
    @paulerickson5116 Год назад

    Hash code was to uniqify by value

  • @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 Год назад +1

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

    • @BooleanDev
      @BooleanDev 6 месяцев назад

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

  • @timothy6966
    @timothy6966 9 месяцев назад +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 9 месяцев назад

      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.

  • @Gabriel_Bento
    @Gabriel_Bento 8 месяцев назад

    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

  • @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.

  • @AbhishekSaral
    @AbhishekSaral Год назад

    Flutter nothing but Magic

  • @intuneknight9681
    @intuneknight9681 7 дней назад

    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.

  • @deadvirgin428
    @deadvirgin428 Год назад

    Someone please fix the Odin implementation, it's so damn bad.

  • @maometos
    @maometos 4 месяца назад +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.

  • @antonpieper
    @antonpieper Год назад +3

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

  • @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.

  • @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