Re:Pipe Operator (|>) For JavaScript
by nightpool on Friday January 20, 2023 @11:29AM
(#34455444)
> 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.
Re:Pipe Operator (|>) For JavaScript
by BigJono on Friday January 20, 2023 @11:37AM
(#34455594)
Yes 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.
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.