local

Ingvar von Schoultz ingvar-v-s at comhem.se
Wed Aug 20 08:21:58 PDT 2008


The keyword "let" breaks the very valuable JavaScript tradition
of using intuitively meaningful keywords.

JavaScript uses the word to say "local", but its normal English
meaning is "allow".

All other JavaScript keywords help you understand the program
text. Most of them suggest a translation from statement to
plain English that conveys the meaning reasonably well. The
totally off-the-mark meaning of "let" makes it strange and
foreign.

You'd get nicely intuitive plain English if "local" were used
instead:

     if (x == 5)
     {   local y = 3;
         z = x * y;
     }
     for (local Key in List)
         ++List [Key];

Of course one can easily guess intuitively at the historical
accidents that have led people to use "let" when they really
mean to say "local". But that's no reason for burdening
JavaScript with such an off-the-mark word, in my opinion.

-- 
Ingvar von Schoultz



More information about the Es-discuss mailing list