local

Michael Haufe TNO at TheNewObjective.com
Thu Aug 21 06:12:12 PDT 2008


"The problem with "let" isn't inexactness or incompleteness, it's
that it's completely off the mark and unrelated, when read as
plain English. All other keywords are closely related to their
in-program semantics in some way. "

As was stated earlier this is debatable. A quick search of the internet 
will show many contexts in which this word is used to denote exactly or 
similarly what it means here.

The Dictionary definition: "To grant the occupancy or use of ..."

Math statements: "Let x = the number of apples in the basket"

Similar use in other programming languages...

Perhaps Brendan or someone else can shed light on the original decision 
making process of "let"'s inclusion in JavaScript 1.7?
------------------------------------------------------------------------------------

Ingvar von Schoultz wrote:
> Steven Johnson wrote:
>> If intuitively-plain English is a requirement, we'll have to change some
>> existing keywords... e.g., I submit that the meaning of "for" has 
>> little to
>> do with typical English usage.
>
> You can read "for..." as and abbreviation of "for each value i
> between 0 and 5, do this."
>
> Keywords don't have to be exact and complete. Given that the
> "for" loop is useful and necessary, expressing it with "for"
> is arguably the closest we can get.
>
> Our starting point must be the constructs that are useful and
> efficient in programming. Given these constructs, we try to find
> suitable words. This means that keywords will necessarily be
> inexact and incomplete.
>
> The problem with "let" isn't inexactness or incompleteness, it's
> that it's completely off the mark and unrelated, when read as
> plain English. All other keywords are closely related to their
> in-program semantics in some way.
>
> Regarding "for", a worse problem is this:
>
>     for (var key in map) {...}
>
>     for each (var value in map) {...}
>
> Both constructs expand into the same plain-English sentence. I
> think this would be better:
>
>     for (var key in map) {...}
>
>     for (var value in values map) {...}
>
>     for (var [key, value] in [keys, values] map) {...}
>




More information about the Es-discuss mailing list