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?
Source: Tips4all
The technical overview seems to summarize the difference quite well:
ReplyDeleteclasses: while JavaScript is object oriented and it does provide classes (at least in its latest incarnations), it is really a prototype-based language and not a class-based language. While that is not inherently worse, it is different from most major OO languages, which makes it harder to learn for most people.
(optional) static typing: You can't do static typing (as in: "checked by the compiler") in plain JavaScript. The advantages (and disadvantages) are well-known and have been widely discussed.
language support for libraries: "loading that file before this" is a very primitive way of implementing libraries and most modern languages have explicit support for libraries in some way.
That page also mentions tooling, but that's not an inherent difference between languages. Granted, a statically compiled and typed language is easier to write good tools for, but this is not a fundamental difference that can't be solved by programming.
The main issue I see it as solving that of creating large, multi-developer applications.
ReplyDeleteIn 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.