4 ms·
April fools is early, huh. Who actually writes "Zen Javascript" in Production? Examples, please.
by hellbanner 12y ago
April fools is early, huh. Who actually writes "Zen Javascript" in Production? Examples, please.
- ashark 12y agoThe only time I feel "zen" writing Javascript is when I'm writing it as much like C as possible, without touching the DOM, without using 3rd party libraries (the API of which invariably ruins any "zen" I've got going on) and certainly without using Node. I don't mind it as a kind of toy language for playing with algorithms in JSFiddle. Real-world Javascript, in my experience, is a constant struggle to cram a dozen call styles for your various npm-fetched libraries in to something resembling coherence, and god help you if you have to dig in to the code of any of those libs, because there are so many different styles and commonly-used libraries serving the same purpose as one another that it's likely to be like reading a completely different language from what you've been writing. A dozen competing approaches each for making the language suck less at doing useful things, code organization, call chaining, et c., and every goddamn one of them is present somewhere in your stack. The language is kind of OK. Zen enough in small, controlled doses, once you know about the usual unintuitive (backwards, broken) stuff like variable scoping. The ecosystem, every place the language touches the browser (not Javascript's fault, really), and Node are ripping-your-hair-out un-Zen, IMO.