Re: Explicit feature manifesting for backward-compatibility safety (Was: Comment syntax)

On Tue, Aug 28, 2012 at 4:00 AM, Marat Tanalin | tanalin.com
<mtanalin@yandex.ru> wrote:
> I'm not going to argue further; just want to mention another (relatively recent) example (I somehow forgot about it in my previous message) of such switch used in JavaScript (introduced in JavaScript 1.8.5 / ECMAScript 5) [1]:
>
>     "use strict";
>
> It has many of "hazards" you've mentioned as for switches, but it has not prevented this feature to be introduced into language.

It has less hazards, with good reason - they made it so it can be
turned on at a function level, not just globally, and it doesn't
change fundamental parsing.

However, you'll note that they decided *not* to continue with this
tradition for ES6 - ES6 forwent some syntax features as they decided
that being able to silently upgrade without a switch was more
valuable.

~TJ

Received on Tuesday, 28 August 2012 15:49:06 UTC