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

28.08.2012, 04:33, "Tab Atkins Jr." <jackalmage@gmail.com>:
> On Mon, Aug 27, 2012 at 5:20 PM, Marat Tanalin | tanalin.com
> <mtanalin@yandex.ru> wrote:
>
>> š28.08.2012, 03:27, "Tab Atkins Jr." <jackalmage@gmail.com>:
>>> š"Big red switches" like this are an anti-pattern. šOccasionally they
>>> šcan be useful, but they're hazardous and should be avoided if
>>> špossible.
>> šWe already have this "anti-pattern" with DOCTYPE and with X-UA-Compatible. If language cannot be improved without such switches, this is fine pragmatic way to go that is much better than doing nothing.
>
> Yup, DOCTYPE switching was a necessary solution to a very bad compat
> problem. šThe benefit outweighed the badness. šX-UA-Compatible is
> similar (though note that it's not endorsed by any vendors other than
> IE and Chrome Frame, I think, because the pain isn't worth it to
> anyone else).

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.

> You have to justify the big red switch.  I don't think // comments
> come *anywhere* near sufficient benefit to overcome the pain of a
> switch.

If it's not obvious, scope of my proposal is much bigger than just one-line comments (I personally am pretty happy with LESS that supports one-line comments).

The proposal is a _universal_ way to extend CSS without endless wasting of time complaining about backward compatibility.

[1] https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Functions_and_function_scope/Strict_mode

Received on Tuesday, 28 August 2012 11:01:10 UTC