- From: Tab Atkins Jr. <jackalmage@gmail.com>
- Date: Tue, 28 Aug 2012 08:48:11 -0700
- To: "Marat Tanalin | tanalin.com" <mtanalin@yandex.ru>
- Cc: "Kang-Hao (Kenny) Lu" <kanghaol@oupeng.com>, Zachary “Gamer_Z.” Yaro <zmyaro@gmail.com>, Liam R E Quin <liam@w3.org>, WWW Style <www-style@w3.org>, "Jens O. Meiert" <jens@meiert.com>
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