What is the use of the Dart language over JavaScript (Node.js)

I do not see the point of Dart regarding the problem they are trying to solve.

I read that it was created due to short JavaScript errors, however these short sentences were not provided.

Can someone explain the benefits of learning Darth and not learn Node.js?

+46
javascript dart
Oct 10 '11 at 11:28
source share
2 answers

The technical review seems to summarize the difference quite well:

  • : while JavaScript is object oriented and does not provide classes (at least in its latest incarnations), it is really a prototype based language, not a class based language. Although this is not inherently worse, it differs from most of the main OO languages, which complicates the study of most people.

  • (optional) static typing: you cannot statically enter text (as in: "checked by the compiler") in plain JavaScript. The advantages (and disadvantages) are well known and widely discussed.

  • language support for libraries: β€œdownloading this file before” is a very primitive way to implement libraries, and most modern languages ​​have some kind of library support.

This page also mentions tools, but it is not an inherent difference between languages. Of course, a statically compiled and typed language is easier to write good tools, but this is not a fundamental difference that cannot be solved when programming.

+40
Oct 10 '11 at 11:32
source share
β€” -

The main problem that I see as a solution for creating large applications with several developers.

In Javascript, I can write perfectly correct code:

function x(y) { return y*y; } document.write(x(3,4,5)); 

And it will do just fine, but this is clearly a mistake.

Now separate the function definition and function call by several developers and several months over a code base of several thousand lines of code.

The original function x (y) could initially be a function of x (y, z, a), but has since been reorganized over time. Here, javascript fails for me, and this is what the dart will help solve.

Edit (May 2013) In addition to my answer above, which I believe remains true, I think the performance history is also becoming quite convincing. Lars Buck and Casper Lund chatting with Google I / O provide some evidence.

+62
Oct 18 '11 at 20:55
source share



All Articles