On Oct 4, 2011, at 10:52 AM, Mikeal Rogers wrote:
> But, some of them simply double the semantics and syntax in the language
> without a path to deprecate previous syntax. I'm a big fan of let, but if you
> don't deprecate var we're going to have to contend with new programmers
> keeping two sets of scoping rules in their head.
You mean by deprecate what, exactly?
Web JS is full of var. Making any attempt to migrate a big hunk of it to ES6
require replacing all 'var' with 'let' is a huge tax, since scoping works
differently.
Ok, how about saying if you use 'let' in a function or at top level, you can no
longer use 'var'? That's less of a tax on average, but for a long program or
single function, it's as bad.
On the web, deprecation is separate from obsolescence. You don't remove the bad
old thing until the good new thing is out and about and actually in use. You
might have to wait for the bad old thing to wither almost to nothing, all by
itself.
Or sometimes a breaking change that actually improves semantics, rarely breaks
valid content, and has better security can be shipped sooner. Examples include
window name targeting and mixed http:/https: content not loading the http:
content (IE9 does this, good on them).
'var' is not such a case.
> Brendan said something very interesting in his talk at JSConf.eu, he said
> that because of the way TC39 works any new proposal that doesn't have (and I
> hope I'm paraphrasing this right) "sexy syntax to start with doesn't have
> much of a chance".
I never said that. In particular, I did not say "sexy", and I didn't say
"start" -- here's proof. <| and .{ are proposed for ES6. They aren't quite
right, many on the committee and in the community believe. That doesn't mean
they'll fail to be included under some syntax -- the semantics are good
(although .{ is just Object.extend, so the API would be good by itself).
What I said was that it's hard to agree on syntax unless the proposer nails it,
really (no double entendre there!). Often by using syntax from a nearby
language. Even then, .e.g. generators (we distinguish them at the head via
function*) and block-lambdas, some who don't know or do not like the nearby
language balk.
My main point was that syntax is hard. But syntax is UI and JS's UI has real
usability bugs. I'm glad you find it easy to teach. That's not the only
consideration though, because after people learn a language, as they keep using
it they do progress to become fluent, even expert, at it, and its usability
problems come to the fore.
/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss