by BrendanEich · 11y ago · 0 comments
Doubling the testing load, making hidden time bombs for older browsers to find blowing up in their faces at later dates: Not Good.
Elsewhere here, both Alon Zakai I question the wisdom of using an erased "use sanity"; mode directive, given that runtime semantics will diverge for any code not in the new subset. The hope is that people will test fully with checks on, and find all code that doesn't follow the rules. I think TC39 will balk at this hope. Murphy was an optimist.
/be
> The hope with sane mode (or whatever less able-ist name it should have) is to have no runtime semantic change if the mode directive is not recognized
From my limited understanding, old browsers can't handle 'let' anyway, which is supposed to be used exclusively on this mode (as there will be no 'var'). But you probably know more about this than me.
> making hidden time bombs for older browsers to find blowing up in their faces at later dates: Not Good.
Doesn't that happen all the time? What I mean is: If ES6 becomes widely supported in browsers, pages written on it will make old browsers "blow up", too. Unless the people who program those make two versions, which defeats the point of using ES6 in the first place. The same when a new version of CSS comes out - use that, and the old browsers "blow up", too.
It seems to me it is the nature of the beast - new features make old browsers blow up.
> Doesn't that happen all the time?
You're talking about new syntax bombing old browsers. That's not the issue. The issue is same syntax in old and new, works (for whatever value of "works") in old and new, but differs in meaning due to a "use sanity"; directive.
For what is worth, I never depend on the truthyness of falsyness of 0 and "", and always test for them explicitly, so it will not affect my code if in a distant future javascript starts treating them as truthy. Just, you know, in case you change your mind in the future.
Good night!
Update: this does not say 0 == "" of course, separate issue.
/be