3 ms·
I like the idea of stricter modes for JS but shuffling around const/bar/let is both not very productive and rather confusing. Imagine explaining to beginners th
by hardwaregeek 4y ago
I like the idea of stricter modes for JS but shuffling around const/bar/let is both not very productive and rather confusing. Imagine explaining to beginners that let is actually const and var is actually let. The arrow function one is a nonstarter because arrow function syntax is already kinda ambiguous and adding that would make it extra super ambiguous, like literally impossible to parse ambiguous.
Really what I’d want from a stricter JS is control over mutability, prototypes, and eval. Basically restrict dynamicism so you can do more effective static analysis over code. I’d also love some reduced syntax like no comma operator, no for…in, no ==. It’d be interesting if tuples/records could be introduced in this context. Basically make a sub language that’s more immutable and static.