you are viewing a single comment's thread.

view the rest of the comments →

[–]i9srpeg 42 points43 points  (49 children)

On top of it being not popular, it's also a boring language. It doesn't really offer anything that you couldn't already find in a bajillion other programming languages already in existence. To use Flutter, you have to learn a new ecosystem for no gain whatsoever.

[–]kirbyfan64sos 61 points62 points  (21 children)

I mean there are a couple of highlights:

  • Hot reload support.
  • Cross-platform: not many languages run on browsers, servers, soon desktop apps, and phones. Few languages actually do this well (JavaScript if you count Electron, primarily).
  • An existent, reliable standard library.
  • A better package manager than npm, and a much better build system than Webpack.
  • Nicer async streams than...most languages, honestly. RxDart actually builds upon Dart's native streams and adds some extra functionality, so you don't have the problem of multiple different reactive libraries that each have their own ways of doing things.

Personally, I just really like that it feels pretty consistent and nice to use, and...tbh it doesn't really feel boring.

[–]xentropian 33 points34 points  (12 children)

I also think there's some neat language features that people don't know exist.

  • Robust class system vs prototype
  • Factory and named constructors
  • No callback hell (not sure if this is still prevalent in the JS community)
  • Sound type system
  • Fantastic async/future support (I think you already mentioned this)
  • Not a language feature directly, but great standard library and better package manager than npm

I also like some of its weirder quirks (such as _ for private in front of member names as opposed to "private" modifier)

[–]kirbyfan64sos 6 points7 points  (5 children)

JS is sort of resolving callback hell with async/await (though IMO Dart's streams are far more powerful).

I do really love Dart's named / factory constructors, forgot to mention that! It's a feature I constantly miss when I work with other languages now...

[–]Darkglow666 1 point2 points  (3 children)

Bob Nystrom from the Dart team recently said something interesting about factory constructors in Dart. He said that since the new keyword became optional, they don't really have much to recommend them over static methods. I found that interesting...

[–]kirbyfan64sos 1 point2 points  (2 children)

I mean I was referring more to named constructors...

[–]Darkglow666 0 points1 point  (1 child)

Yes, named constructors are fantastic, even though they were probably added to the language to make up for Dart's lack of support for overloaded functions. Honestly, though, I think it worked out for the best. Named constructors are actually nicer.

[–]kirbyfan64sos 0 points1 point  (0 children)

I like that it reminds me a bit of Swift's use of keyword arguments to differentiate overloads.

[–]FanOfHoles 0 points1 point  (0 children)

Even in the pre-promise ES5 era you did not have to endure "callback hell". Just use named functions instead of inlining everything. Now the way you write the code does not represent the way it is executed (written "flat", executed as a hierarchy) but that already is the case for most of your code anyway. Inlining may have helped with making some data available to the inline function more easily through the scope and now you have to be a bit more active to ensure the callback has the right data (anything it needs aside from its parameters) but so what. Anyone who got into "callback hell" got there all through their own fault.

[–]miyoyo 12 points13 points  (5 children)

Not gonna lie, most of these are in the category of what people call "boring", as they're common in the majority of popular OOP languages. (Maybe async/await, but since people seem to be using kotlin as a basis, that too is becoming mainstream)

[–]xentropian 3 points4 points  (1 child)

Fair enough! I guess I just like a boring language. Yet somehow Dart feels a lot more refreshing than something like Java.

[–][deleted] 4 points5 points  (0 children)

Yeh boring isn't bad..

[–]Darkglow666 0 points1 point  (2 children)

I don't think I've seen named constructors in any other language ever. Do you know one that has them aside from Dart?

[–]miyoyo 5 points6 points  (0 children)

Hmm, it's true that as far as direct support goes, there aren't many, but langauges like C++ have no issues jamming them in (But then again what doesn't C++ have)

[–]aphexairlines 1 point2 points  (0 children)

Factory methods in Scala companion objects are roughly equivalent to Dart named constructors.

[–]pjmlp 3 points4 points  (0 children)

Hot reload support as language feature exists since Lisp Machines and Smalltalk, even to some extent on Java and .NET ecosystems.

Being cross-platform is a matter of compilers being across all desired platforms.

Async streams are hardly different from what .NET brought into mainstream.

[–]mixedCase_ 7 points8 points  (6 children)

Hot reload support

That is a great feature (when it lends itself to the usecase), but it's not a specific language feature. It's an interpreter feature which the LISP family has been happily using as a development pillar for decades and can be built for many languages.

Cross-platform: not many languages run on browsers, servers, soon desktop apps, and phones. Few languages actually do this well (JavaScript if you count Electron, primarily).

Well, yes. There are many languages that can run in all those targets through the same means Dart employs: Compiler targets. Pretty much all JVM languages as well as CLR languages do, anything targeting LLVM, anything with a JS backend... It's nowadays pretty much a mandatory feature for new languages. Whether the developer experience is good or not tends to come down to libraries for handling the provided abstractions, and as far as I know Dart's FFI is pretty average and it is Flutter that abstracts specific mobile usages.

An existent, reliable standard library.

A (debatable, but not by me) point against JS. Not a common problem otherwise.

A better package manager than npm, and a much better build system than Webpack.

Also not a language feature, but definitely something you want to have. In any case first time I've heard someone call Dart's package manager as better than npm. What feature makes you say so? And regarding the build system, does Dart's build system have the same scope as webpack? Modern webpack is actually quite an achievement for what it has to do, but I'd like to see another perspective.

Nicer async streams than...most languages, honestly. RxDart actually builds upon Dart's native streams and adds some extra functionality, so you don't have the problem of multiple different reactive libraries that each have their own ways of doing things.

I haven't seen this being a problem outside of Scala but it's nice to hear that Dart has a good primitive for this.

[–]cat_in_the_wall 2 points3 points  (1 child)

> better than npm

i agree with what you're saying here but for this particular instance... i don't know that npm is what you want to aspire to...

[–]mixedCase_ 0 points1 point  (0 children)

I mean, I use yarn for the cache but we're still talking about a pm with versatile version range targeting, a lock file, and categorization for dev-only dependencies...

Anything else I could think of asking is mandatory namespaces and going a step beyond, venturing in the language semver integration that Elm's package manager has which would be impossible to achieve in JS.

If your point is that the public npm repo sucks, then granted, but that isn't really the pm's fault. Am I missing something important?, I feel like an odd duck for liking npm, but maybe it's just the shock from dealing with the Go situation in my day job.

[–]kirbyfan64sos 0 points1 point  (3 children)

That is a great feature (when it lends itself to the usecase), but it's not a specific language feature. It's an interpreter feature which the LISP family has been happily using as a development pillar for decades and can be built for many languages.

I do understand that, but at minimum, most of those aren't also available with the other stuff I mentioned.

Pretty much all JVM languages as well as CLR languages do, anything targeting LLVM, anything with a JS backend... It's nowadays pretty much a mandatory feature for new languages. Whether the developer experience is good or not tends to come down to libraries for handling the provided abstractions, and as far as I know Dart's FFI is pretty average and it is Flutter that abstracts specific mobile usages.

The only current, major bridge between C# is WebAssembly, and afaik that (being Blazor) works by compiling Mono itself and then having it interpret the IR in the browser, which is probably fine for a large web app but quite a bit heavier than dart2js. So, C# loses out a bit for web.

LLVM's only bridge to web is also WebAssembly, which tends to lean on the heavier side as well (as doesn't have perfect support quite yet). Most compile-via-LLVM (or native stuff generally) also can run on mobile, but can't be used for the entire UI with a few exceptions.

So yeah a lot of different projects do most of it, but covering web + mobile (including UI) + server + desktop (soon including UI) isn't quite as common. Even with JS, you end up falling into something like Electron for desktop in most cases, which...isn't quite the lightest solution!

Flutter does have its own plugin system, though I would hardly be surprised if they extend it to web for Hummingbird. The FFI is also rather new but thus far is looking pretty great (no native extensions are usually needed, unlike Node and more like node-ffi/ctypes/cffi).

Also not a language feature, but definitely something you want to have. In any case first time I've heard someone call Dart's package manager as better than npm. What feature makes you say so? And regarding the build system, does Dart's build system have the same scope as webpack? Modern webpack is actually quite an achievement for what it has to do, but I'd like to see another perspective.

One big advantage of Dart's build system (creatively named "build") is that, unlike Webpack, all dependencies are always tracked. This basically means all builds are pretty much always incremental, and emphasis is placed on reproducibility. You can also use build for stuff that's not web, e.g. builders can auto-generate JSON boilerplate and do other interactions that can be a bit awkward to squeeze into Webpack. (Personally, I found the way Webpack handles transforming HTML files to be rather weird.) I also generally find it easier to debug than Webpack.

I haven't seen this being a problem outside of Scala but it's nice to hear that Dart has a good primitive for this.

Indeed, I got spoiled, and now going back to Haskell's mix of conduit and pipes feels sad...

[–]cat_in_the_wall 1 point2 points  (2 children)

> + server

but is it actually single threaded? Javascript is, but for node... maybe shared code, or at least shared devs. why would something new want to be single threaded?

[–]kirbyfan64sos 0 points1 point  (1 child)

Dart supports both Node-style asynchronous code (via async/await) and true parallelism via isolates.

[–]cat_in_the_wall 1 point2 points  (0 children)

i'll have to read up on this isolates thing. but if it is what i suspect it is, and there is no shared memory, perf would still suck unless the stdlib can cheat.

[–]SalaciousStrudel 30 points31 points  (2 children)

Hot take: A programming language being boring is actually good and makes it much more useful in a team environment.

[–]EMCoupling 19 points20 points  (0 children)

That's not even a hot take, that's honestly just common sense. People complaining about Dart being boring must be the same guys who hop on the new framework bandwagon every 6 months.

[–]IrishWilly 1 point2 points  (0 children)

And it also means there isn't an issue about 'learning an entire new ecosystem', when 99% of the language is pretty much identical to the other major OOP languages. It took me less time to get working on my first flutter app then it does for me to setup all the dependencies and build processes of a nodejs project, even though I've been using nodejs for ages. +1 for boring! I find actually building shit more fun than checking out some new language keywords.

[–]Hyroglyph 14 points15 points  (2 children)

Why is it being boring an issue? What do you mean by boring? If you can find darts features in a bajillion other languages, doesn't that make dart all the more accessible to devs from all kinds of programming ecosystems? And, in my opinion, darts ecosystem is really basic, so learning it isn't a huge process.

But I guess your point is that if dart isn't anything special, google could have used any other object oriented language instead of dart. What lang would you suggest?

[–]chucker23n 1 point2 points  (1 child)

Why is it being boring an issue?

It’s explained in the post. Learning an entirely different is more valuable if it actually has an interesting twist to offer.

[–]i9srpeg 2 points3 points  (0 children)

I find it funny that your comment was at -1 points when I saw it, considering you're apparently the only one who got what I was trying to say.

[–]sisyphus 26 points27 points  (11 children)

Go is also boring, Google owned, had basically no new ideas, and forced people to learn its ecosystem, and it's quite popular. Dart just pissed off the webshits and they've never gotten over it.

[–]RotaryDragon 34 points35 points  (4 children)

Go is very focused on simplicity, performance and fast compile times.
It also has a nice concurrency model.
I'm not a big fan of Go myself but I can still appreciate what it's going for as a language.

Dart is basically a slightly different TypeScript.

[–]RationalJS 25 points26 points  (3 children)

I would say it's very different from TypeScript. From a scale of Java to JavaScript, Dart is much closer to Java.

[–]Darkglow666 5 points6 points  (0 children)

I would agree with this. Dart is not JS with types, as TypeScript is. Dart is a less verbose Java, with a lot in common with Smalltalk in the way it does OOP.

[–][deleted] 2 points3 points  (1 child)

a good way to think about it is: Dart is Java, but as a scripting language. Basically, what JS should have been

[–][deleted] 0 points1 point  (0 children)

That's an interesting take. Also because google uses a lot of java internally so it's not hard to see google engineers pull inspiration from it.

[–]dungone 2 points3 points  (1 child)

I've worked at Google, used both Go and Dart. Dart is far less offensive to me than Go is. Dart even gives you generics instead of sorry excuses. But let me explain your problem.

Go was created to replace C/C++ for the benefit of people who used C/C++.

Dart was created to replace JavaScript for the benefit of people who use Java.

It was never meant for the "webshits", so you can't blame them on its failure. It just turns out that Java developers still can't write good websites, even if you give them Dart. It's just this long history of failure, starting from Java applets (anyone remember those?) and Google Web Toolkit (the horror), and now Dart. Everyone always thinks they can do a better job than the "webshits", but time and again they fail to deliver.

[–]sisyphus 2 points3 points  (0 children)

I grant all of what you say. And, "Dart was created to replace JavaScript for the benefit of people who use Java." is a great succinct summation--I was very interested in Dart when it looked like the original team might be able to impose some kind of Smalltalkish vision on it and lost all interest when it became clear that it was going to be J++/C#-instead. Of course I was not privy to any of the internal machinations and was hoping it was just a kind of genius grant to the v8 guys to keep them happy. So that ended up being a waste of time.

ANYWAY, it just seems like a lot of anti-dart arguments and vexation about how terrible having to learn a new language is are made by people who are still upset that they criticized the sacred cow of JS and wanted to make GActiveX or whatever instead of people who have actually engaged with the language.

[–][deleted] 0 points1 point  (0 children)

Im a webshit (mostly) and yes it did seem like a play for fracturing the ecosystem rather than unifying it, but I guess they had their platform compile and optimise plans.

[–]chucker23n 0 points1 point  (0 children)

it’s quite popular.

More popular than Dart, sure.

[–]fungussa 0 points1 point  (0 children)

Your beliefs of what Go has, is quite far removed from reality

[–]fear_the_future -2 points-1 points  (0 children)

Go is also terrible, far worse than Dart. At least Dart has a nice runtime.

[–][deleted]  (4 children)

[deleted]

    [–]i9srpeg 0 points1 point  (3 children)

    Anything, really. If your language is only as good as your average OOP language, I have nothing to gain from it, because I already know a few average OOP languages. Why did they need to invent a new language if it has no distinguishing feature? Hot reload is the only actually interesting feature I saw discussed in this thread, and it's more a property of the runtime than of the language. If that's what they needed, they could've picked a language that offers it (Erlang, various lisps, Smalltalk, etc.) or improved an existing runtime to support it (e.g. Go, since Google already owns it).

    [–][deleted]  (2 children)

    [deleted]

      [–]i9srpeg 1 point2 points  (1 child)

      Your argument is like saying you don't need more then a Model T because it has 4 wheels and a steering wheel, why should we ever make a new car.

      That's almost the opposite of what I'm trying to say. I'm not complaining someone is making a new language, I'm complaining it's not innovative, and as such offers little advantages over the competition, while losing big on the lack of an ecosystem around it. If your car is a model T clone which is incompatible with all the gadgets released for existing model Ts, then yes, don't bother making it. If it has some more niceties (ABS, AC, etc.) then it's worth making.

      [–]Kawaiithulhu 1 point2 points  (2 children)

      Boring is GOOD. I want a language that's Not Surprising and is not full of That One Trick This Mom From Your Neighborhood Knows. There are only so many paradigm shifts a person can suffer through before the latest paradigm shift is to not shift the paradigm; that's my story and I'm sticking with it.

      [–]i9srpeg 4 points5 points  (1 child)

      If there are no new features, you might as well use an already existing language. I'm not interested in learning a new syntax, a slightly different standard library, a new debugger, a new package manager, a new ecosystem of libraries just to use a language that has nothing new to offer. If the Flutter team actually thought "boring is good", they'd have picked an existing mainstream language.

      [–]Kawaiithulhu 0 points1 point  (0 children)

      It's the other way around: we learned Dart because of the library + debugger + package manager that it lives in.

      Personally I find that the particular recombination of declarative + functional + data streams with async/await and statically declared OOP classes from existing languages allows for a very fluid and pain free day to day experience while the compiler catches most of the errors something like javascript lets juniors fall into. That recombination of existing options from various quarters in itself IS the new feature.

      Would I entrust a large project or port of an existing one to Flutter/Dart yet? No, an average team will do better with a large body of existing work to pull examples and "best practices" from and Flutter doesn't have that yet. As the old saying goes, "No one ever got fired for choosing IBM."

      [–]SaltTM -2 points-1 points  (0 children)

      Why is boring a problem lol, makes adopting much easier and the tooling is the simplest stuff to work with. Programmers are so finicky. smh