📜 ⬆️ ⬇️

Why I do not believe in Dart

Frankly, I met the message about the development of the Google language Dart with bewilderment. If I considered coffeescript and other add-ins to be just someone’s entertainment at leisure, I don’t seem to treat Dart as if it were just another geeky toy.

Today's post about the future dominance of Darth prompted me to articulate, finally, why I consider Dart to be just a geek toy and what is wrong with Google. I’ll start with a quote:

“We need a complete replacement of JS - a wide profile language: from simple scripts, for complex applications”
')
What is wrong with her? Yes, the fact that JavaScript is a wide profile language, from complex scripts to complex applications. JavaScript is a high-level and extremely powerful object-oriented language, and that is why all attempts to “improve” it fail miserably (well, for now, at least).



There are some obvious annoying flaws in JavaScript, such as declaring a global variable without var, a stupid table of comparisons or the absence of for ... each. In all honesty, these are not at all fatal flaws for a programming language. The main problem with JavaScript is the low prevalence of prototype object-oriented programming as opposed to "class-based" object-oriented programming. The desire to make JavaScript “normal” language leads to some kind of monstrous structures and completely discourages the desire to work with it. It is necessary to abandon the class paradigm - and working with JavaScript becomes easy and enjoyable.

In my opinion, precisely because of the unwillingness to accept the JS paradigm, the desire to make a metanadstroy over it results. In order to reasonably talk about replacing JS with another language, it is necessary to show that the problems of using JS stem from the language itself , and not from the extremely specific environment in which JS operates.

I am perplexed by this kind of statements:

But while writing applications, certain problems still remain: it is possible to write applications without the need for classes / typing, but difficult — many tools that allow the same Java to have productive VMs and smart IDEs do not apply to JS.


Writing applications on prototypes is no more difficult than on classes, and the IDS for JS is already a smart car written - WebStorm, NetBeans, Eclipse, Comodo, Aptana. WebStorm copes with such non-trivial tasks for JS as moving to the method declaration or refactoring the class interface.

Let's try to carefully analyze Google’s argument in favor of replacing JavaScript:

Dash is designed with three perspectives in mind:

- It is possible to create it.

- Developer Usability - Javascript

- Ability to be Tooled - for example, it is necessary to make it possible.

Developers can still be satisfied with the text editor.


1. Performance. Here, I confess, Google’s argument looks ridiculous. Server V8 is certainly no slower than Python, which is used in GAE; I somehow do not come up with dynamic interpreted languages ​​that would be more productive than V8 JavaScript. Those who tried to use JS on servers will tell you that the main problem with V8 is stability, and not performance at all. It seems that Google could easily finish the V8 to a normal stable server scripting language, but does not. Why?

The main thing that surprises me in the passage about the performance of JavaScript is that Google perfectly understands that the main thing is infrastructure, not language performance . Remember how Google representatives laughed at Microsoft . The secret of Google's performance is in the file system and datastore, and not at all in the performance of the programming languages ​​used. Node.js with its asynchronous nature, it would seem, is ideally suited to Google architecture.

2. Usability. This argument is generally beyond my comprehension - Google is going to create a Dart as convenient as JavaScript - so what does JavaScript not like in this place?

What, Dart is simple and obvious for beginners? Haha three times. I am looking at this tutorial:
class Greeter implements Comparable {
  String prefix = 'Hello,';
  Greeter() {}
  Greeter.withPrefix(this.prefix);
  greet(String name) => print('$prefix $name');

  int compareTo(Greeter other) => prefix.compareTo(other.prefix);
}

. , , .

3. . , WebStorm JS-; , , , IDE — , JavaScript.

, , Dart «» JavaScript — - , . , , ; — , .

, Dart — - , . : , — , ; « » , . JavaScript .

, , , . .

Source: https://habr.com/ru/post/130589/


All Articles