When you use var.,.well we know the result. I think we should basically
name using hoisted var as "Crockford's js" because he has a patent on
hoisting var declarations, and if you're using var and not hoisting you're
"doing it wrong"[citation]. If you are, in es6, using var and hoisting,
you're doing what Crockford says but you're definitely doing it wrong, and
now you're just "behind the times".


On Wed, Dec 26, 2012 at 9:11 PM, Rick Waldron <waldron.r...@gmail.com>wrote:

>
>
> On Wednesday, December 26, 2012, Brandon Benvie wrote:
>
>> I guess to sum up what I think Domenic was saying: people hoist var
>> declarations so that their code acts the way the engine is going to execute
>> it in order to prevent a mismatch between expectations and result. If there
>> wasn't a reason to do that (AKA TDZ-UBI) then it wouldn't be done, because
>> it's not otherwise desirable to do.
>>
>>
>>
> Conversely, many also believe there is benefit in having a single place in
> a function to locate all of the formal parameter names and initialized
> identifiers. Assignment close to use also embraced by this pattern.
> Subjectively, this makes it easier to identify free vars used in the
> function.
>
> Many also believe that hoisting is an excellent feature, not a weirdness.
>
> Rick
>
>
>
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to