Re:Lambda School leaked documents show poor performance over...
by sam0x17 on Tuesday October 26, 2021 @03:29AM
(#28997415)
> I wonder if there would be a market for a "stricter mode" version of JavaScript that simply does not allow you to use the legacy features that are so quirky.
It's almost like we could use a better frontend language. Too bad there isn't some magical universal assembly language supported by all major browsers we could use as a launchpad for such a thing ;)
Re:Lambda School leaked documents show poor performance over...
by threatofrain on Monday October 25, 2021 @03:54PM
(#28992310)
That's something which can be done at build time, such as through a linter.
Re:Lambda School leaked documents show poor performance over...
by skrebbel on Monday October 25, 2021 @04:40PM
(#28992846)
Some of it would need to be runtime checks to be fully consistent and unsurprising, I think.
Re:Lambda School leaked documents show poor performance over...
by abecedarius on Monday October 25, 2021 @03:14PM
(#28991879)
I haven't tried it, but somewhere in that neighborhood: https://github.com/endojs/Jessie
Re:Lambda School leaked documents show poor performance over...
by enahs-sf on Monday October 25, 2021 @09:12PM
(#28995256)
these should be expert mode only features that have to be unlocked as opposed to default. So easy to shoot yourself in the foot. Kinda fun if you've been doing it for a while though.
Eg just disallow for...in to be used at all (but allow for...of)
No iterating over objects except via eg Object.entries
No inheriting objects from other objects (ie no prototypal inheritance)
No var
No anonymous functions (ie only named function declarations or lambda/fat-arrow expressions, to avoid `this` binding gotchas)
Etc
I think the only real big blocker to a thing like this is that it'd need tooling (eg a transpiler that injects error throws at appropriate places), and tooling is another big hairy thing that makes JS less approachable for beginners.