3 ms·
Dev lead here for a tiny startup. I selected Dart for front and back end, sharing code between them. It has been a great experience and I don't have many compla
by markdog12 10y ago
Dev lead here for a tiny startup. I selected Dart for front and back end, sharing code between them. It has been a great experience and I don't have many complaints. One of the designer's goals was familiarity. I believe they definitely nailed that goal. We've had experienced devs contributing to the codebase in 3 days without ever seeing a line of Dart code before. And they absolutely love working with Dart. Here's some nice features to those who aren't familiar with the language:
- Class-based, object-oriented
- Static typing
- Generics
- Async/await that makes your asynchronous code look like synchronous code - (avoids callback hell)
- Generators
- Future-based, non-blocking APIs
- Positional, named, optional parameters with default values
- Arrow syntax for brevity
- Type inference
- Packages facilitate modularity
- Named constructors
- Functional programming features (map, fold, reduce, where, take, forEach, etc...)
- Cascade operator
- String interpolation
- Implicit interfaces
- Mixins (Code re-use without complex inheritance hiearchies)
- Reflection
- Streams
- Operator overloading
- Metadata annotations
- Concurrency through Isolates
- SIMD
- Call into JavaScript code and vice/versa
- Generate nice documentation with /// dart comments
- Built-in testing facilites - pub run test
- Open source
- Open standard
- christophilus 10y agoI've never even considered Dart. If I'm going to choose a foreign (to me) stack, I'd prefer it was in a functional language. I'm curious to hear a few things from your experience: how fast/slow are the builds? What cons do you have now that you've been using it a while?
- gcp 10y agoHow many of these aren't available in ES2015 or TypeScript?
- isoos 10y agoI have been exposed to TS a bit, so this list may not be exhaustive, but to name a few that I use on a regular basis: - Consistent async API (incl. Future, Streams, async* for Streams, async/await support everywhere). async.js is nowhere near to this. - Type inference and analyzer toolchain that works and don't need to fall back on grep. The moment you start using anything like lodash or similar you will lose your ability to explore the code reliably. - Isolates and Zones as higher-level constructs for dealing with complex concurrency and parallelism constructs. Nothing comparable in the JS world. - Cascade operator. - 1 != "1" (have been burnt by JS several times, and TypeScript won't provide a break from it) I hope to use soon: - SIMD
- TomMarius 10y ago> - Consistent async API (incl. Future, Streams, async* for Streams, async/await support everywhere). async.js is nowhere near to this. There now are Promises and Promise-based async/await keywords. Sure, there are some legacy APIs, but this is no longer as true as it used to be. > - Type inference and analyzer toolchain that works and don't need to fall back on grep. The moment you start using anything like lodash or similar you will lose your ability to explore the code reliably. TypeScript has introduced mapped and lookup types in its latest version, that solves this problem.
- isoos 10y agoWe have a disagreement on the definition of "solves the problem". Having tried to refactor a codebase with heavy lodash use, that battle seems to be lost. Also, take a look at the async* construct here: https://www.dartlang.org/articles/language/beyond-async https://www.dartlang.org/articles/language/beyond-async Nothing similar is in TypeScript, and this is roughly a two-years old feature in Dart, not a fancy-new hype. I have used it couple of times, it is useful, and again: consistent across the board. Of course if you are happy with the limited promise support in TypeScript, go ahead with it. However saying that they are on-par is far from the truth.