Developers Club geek daily blog

1 year, 1 month ago
Transfer of the letter of Mark Miller, one of participants of committee on standardization JavaScript is offered to your attention. In this letter Mark tells what he can lead "a creeping ficherizm" at design of programming languages to. And why he does not want to add syntax of "let-block" to javascript.



I am not going to support the initiative of adding of such syntax in javascript. Moreover, if somebody volunteers to make it, then I will use the best efforts to dig such undertaking. And that is why.

Developers praised Algol, Smalltalk, Pascal and early Scheme versions for the small size and beautiful syntax. JavaScript and C is reasoned criticized for a miscellaneous and very few people could take them for languages with beautiful syntax. But they had a small size of the specification, and it was always appreciated by developers. When the description of language programming is small, such language is often perceived as "I can learn syntax completely and by that to master language in perfection" which then changes on "I know syntax completely. I like the fact that in language there is no nothing left what I would not know about". Though, of course, for JavaScript and C only the few from those who so think actually are down on to these languages. In their dark corners the set of devilishly confused parts is hidden. Nevertheless, these feelings added satisfaction at everyday use of a programming language.

The esthetics of the small language specification remained up to ES5. I actively participated in development both ES5, and ES6, and I am proud of the contribution to language. Yes, the ES6 specification more than at ES5 is strong, but, nevertheless, language became much better. Considering what we began with, we would not make such progress in ES6 yuzabelnost without considerable expansion of its specification. And I am not sorry about the majority of additions which turned ES5 into ES6. If I had an opportunity to return to the past and to change everything, then I most likely would make still.

But each of additions which turned ES5 into ES6 had to correspond to very high level. Psychologically it played a large role for us as we began with ES5 which specification size all of us still appreciated. When the size of the specification is small, each improvement added to it looks as significant increase in "weight" of the specification. The advantage a feature is clearly visible to those who offer them. But the price of such feature — how many complexity she adds to language is also clearly visible to all to language with the small specification.

When complexity of a programming language exceeds a certain value — for example as at LaTex, Common Lisp, C ++, PL/1 or modern Java, experience of use of such language turns into painful selection "a set a feature" for personal use from the ocean seeming infinite a feature of this language. Which most part we want never to study. Nevertheless, even if the set a feature of language seems to us infinite, we can easily evaluate benefits of separately taken new feature. And here it is already not so simple to evaluate complexity which this feature will add to language. Those who discuss new features for such languages not the methods "feel" the complexity added by these features any more. Infinity plus one — it is all the same infinity. That "death from one thousand cuts" which forces these monstrous languages grow without any restrictions.

Colleagues, I ask you when you evaluate a new feature for language — put higher level than "it would be cool if we could write also so". I believe that the ES6 specification still in that status when there is an opportunity to avoid nothing unlimited growth. But it is possible only if we limit ourselves in desire to fill up still is sensitive a feature and to adhere only to the highest quality standards for everything that we want to add to language. As the community, will not prevent us easy feeling of panic concerning the ES6 specification size. It is ideal if this panic grows, but not to decrease as the size of the language specification approaches a non-return point.

Yours faithfully,
Mark

Note of the translator



It is possible to look at the sentence after which Mark wrote this note here. In it it was offered to add syntax sugar which would allow instead of

{ // блок для защиты локальных переменных
  let a = 2, b, c; // локальные переменные
  ...
}


to write something it seems

let (a = 2, b, c) {
}


The translator shares Mark's opinion. Moreover, I consider that if in a code there was a need to isolate its part in such "let block", then it is time to refaktorit this part nafig in function, a method, miksin or something else. Because complexity does not doze, and Miller's Purse only and waits to snatch to the stood gaping programmer something necessary.

This article is a translation of the original post at habrahabr.ru/post/274739/
If you have any questions regarding the material covered in the article above, please, contact the original author of the post.
If you have any complaints about this article or you want this article to be deleted, please, drop an email here: sysmagazine.com@gmail.com.

We believe that the knowledge, which is available at the most popular Russian IT blog habrahabr.ru, should be accessed by everyone, even though it is poorly translated.
Shared knowledge makes the world better.
Best wishes.

comments powered by Disqus