3 ms·
I think the main reason why Dart was poorly received, was that it is as complicated as a statically typed language, and as unsafe as a dynamically typed one. Th
by continuational 11y ago
I think the main reason why Dart was poorly received, was that it is as complicated as a statically typed language, and as unsafe as a dynamically typed one. The unsoundness is not just superficial; every assignment is a potential run time type error waiting to happen. In practice, there's really no type safety at all, and it isn't used in the optimizer, so why bother?
- rubber_duck 11y agoBecause the tooling is top notch while the language is more flexible/expressive than say C#/Java. Async/await future/observables are built in to std lib, dom API is wrapped up in to them and fully typed, etc. It's not an academically revolutionary language - it's just a really solid practical language, with many modern ideas implemented from start, good tools and should be immediately familiar to C#/Java/TS developers. It has tradeoffs but IMO it fixes so many annoyances in TS/JS.
- discreteevent 11y agoFirstly you can run dart in checked mode which will catch all type errors. Secondly static type checks will catch most errors. Even if there were no type checking at all the types are still hugely useful for documentation, navigation and tooling. Gradual typing can be more productive than pure static typing in that you can play fast and loose when you want to prototype something and then tighten up later when you have arrived at a definition of the solution. Most of your arguments could also be applied to typescript (which doesn't even have the option of runtime tour checking)