4 ms·
TC39 proposals often have rubbish real world examples that should never see the light of day in a JS codebase. It makes me really question the judgement of the
by BigJono 4y ago
TC39 proposals often have rubbish real world examples that should never see the light of day in a JS codebase.
It makes me really question the judgement of the people that are working on this language, and it explains how some of the shittier proposals manage to slip in and why the good ones are misused all over the place in every real world codebase when this is the kind of guidance devs have on where to use fancy new features.
In a few years everyone is going to collectively lose their fucking mind once again and decide that ternaries are now the devil and every React component should be chock full of do expressions. I can see that coming clear as day. That might finally be enough to get me to throw in the towel if the also incoming decorator hell doesn't do it.
- stoned 4y agoI am still hoping that decorators might not pan out :fingers-crossed:
- recursive 4y agoWait, what's wrong with decorators? They seem pretty nice in python.
- tracker1 4y agoI like decorators as a concept... but there have been a couple different implementations now... the TypeScript version is probably the most broadly used, but there were others before it via Babel (formerly 6to5). I was an early adopter of the original decorators proposal as well as the F#-style pipeline operators. The more time has moved on and other bits made it into JS proper, I'm far more inclined to stick to what's "in the box"... Have even considered just writing straight JS + ESM (modules). Of course, I also like JSX, though not sure of any proposals of how to get that "in the box" as e4x died on the vine and a lot of other efforts didn't gain much traction either.
- DarkNova6 4y ago> It makes me really question the judgement of the people that are working on this language Only now?
- nightpool 4y ago> TC39 proposals often have rubbish real world examples that should never see the light of day in a JS codebase. This example was literally taken directly from real-world code in the React codebase (a script to call jest-cli). While you're correct that there are probably a lot of clearer and more readable ways to write this snippet, the fact of the matter remains that people write code exactly like these "real world examples" all of the time.
- BigJono 4y agoYes and those people with a proven track record of writing awful code will now have another new tool to apply their valuable skills with. I can't wait.
- pwdisswordfisha 4y ago> some of the shittier proposals manage to slip in Examples?
- wruza 4y agoReact component should be chock full of do expressions If the motivation behind these features are React components, javascript clearly lacks proper logic in array (and object) literals, like '[' if (cond) […]expr1 [else […]expr2] ']' Although it seems pretty strange to add syntax only because some specific user interface library together with a specific language extension could benefit from it.
- MathMonkeyMan 4y agoDo you mean this? [cond ? expr1 : expr2] Or maybe this: [(() => {/*code*/})()]
- wruza 4y agoMore like this: [...(cond ? [expr1] : [])]