4 ms·
I've been holding out spending any extended amount of time on Dart until 1.0 as the API for it kept changing fairly dramatically since it was first announced (i
by kyrra 13y ago
I've been holding out spending any extended amount of time on Dart until 1.0 as the API for it kept changing fairly dramatically since it was first announced (it was first announced on October 10, 2011 at the GOTO conference).
There isn't anything super amazing about this language from a language perspective, but I think you need to look at what Dart really brings to understand why it may be a nice alternative to JS.
* Optional typing. While typing data is completely ignored at runtime, even in the DartVM, it can help a lot for tooling if you are working on a large project. If you don't care about typing, you can just use "var" for everything.
* Batteries Included: IDE, package manager, core libraries. This means you get decent IDE to start coding in. If you don't like Dart's eclipse-based IDE, JetBrains has been maintaining a Dart plugin for their IDE (IntelliJ or Webstorm). The core library includes a lot of useful classes (not to the level of Java, but definitely has a lot of useful default packages). The package manager is nice to ship with the product as well to maintain use of 3rd party libraries.
* Nice development story. Sure, no shipping browser has the DartVM in it, but when you are doing initial development, you can use Dartium (chormium build with the DartVM in it) to do fast, iterative development. When you need to cross-browser test, you deploy to JS and see how things go.
* Speed. If/when the DartVM starts to ship in Chrome, it should help performance of apps that ship as Dart code. Specifically the runtime performance can be better as their DartVM doesn't have to support a lot of legacy syntax/behavior that JS VMs have to worry about. Along with that, the DartVM supports Snapshots. These are basically a heap dump of an application right before main() is run. This allows Dart apps to start up a lot faster on subsequent reloads.
- Romoku 13y agoWhy not TypeScript?
- kyrra 13y agoFor me: because my background is mainly Java. While I understand prototype inheritance, I'm not as familiar with the programming style of Javascript. I like being able to create strict class structures and use those. Prototype structure allows for ad-hoc creation of a class. This makes code analysis and tooling a lot more difficult to do properly. (I do have to deal with the fun that is Perl on a daily basis, but I'm still more a fan of Java style OOP). Also, my entire professional career has been working on projects that are worked on by 30+ people with a very large code base. When you have large teams using a language that doesn't enforce strict structure, you tend to miss things that could have easily been found at compile-time with proper tooling. This can be accomplished in languages like Javascript, but it requires strict internal controls. Having the language give you that kind of support out of the box is nice to have.
- recuter 13y agoThis is a very clear and perfectly acceptable Raison d'être. It is unsurprising that Dart is by and for the same sort of people that gave us and use(d) GWT. I say godbless and godspeed, but it is very much against the grain of the web and personally I find Typescript, EC6, and projects like Angular and possibly Meteor more exciting by far. To each his own, this does fill a need. The conspiracy aficionados Dart attracts however sure are unfortunate.
- Romoku 13y agoTypeScript is a typed superset of JavaScript. It has classes, interfaces, static typing, and object oriented polymorphism. TypeScript is designed to be used on larger projects.
- tree_of_item 13y agoTypeScript also lets anyone ignore all of that and play cowboys and indians with prototypes.