Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the benefit of the Dart language over JavaScript (Node.js) [closed]

I don't see the point of Dart in terms of the problem they are trying to solve.

I read that it was created due to short comings of JavaScript, however those short comings were not given.

Can someone explain the benefit of learning Dart rather than me learning Node.js?

like image 207
Phil Hannent Avatar asked Oct 10 '11 11:10

Phil Hannent


People also ask

Why is Dart better than JavaScript?

Pros of DartDart is approximately two times faster than JavaScript. Dart is type-safe and compiled with both AOT and JIT compilers. Dart is very scalable across projects. Dart is very similar to Javascript and easy to learn if you already know Javascript.

What is Dart language good for?

Dart is a client-optimized language for developing fast apps on any platform. Its goal is to offer the most productive programming language for multi-platform development, paired with a flexible execution runtime platform for app frameworks.

Is Dart going to replace JavaScript?

Google: Dart will not replace in-browser JavaScript.

Is Dart similar to node JS?

Node. js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices. Dart belongs to "Languages" category of the tech stack, while Node. js can be primarily classified under "Frameworks (Full Stack)".


1 Answers

The main issue I see it as solving that of creating large, multi-developer applications.

In Javascript, I can write the perfectly valid code:

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

And this will execute fine, but it's blatantly an error.

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

The original function x(y) could have originally been function x(y,z,a) but has since been refactored over time. This is where javascript fails for me, and this is what dart will help resolve.

Edit (May 2013) In addition to my answer above, which I believe still holds true, I think that the performance story is also getting pretty compelling. Lars Bak and Kasper Lund's talk from Google I/O provides some evidence.

like image 160
Chris Buckett Avatar answered Oct 19 '22 22:10

Chris Buckett