3 ms·
>even worse language What's wrong with JS, exactly, that isn't made up for by its advantages? I see these 'kool-aid' / 'JS is cancer' comments all the time, b
by nawgszy 8y ago
>even worse language
What's wrong with JS, exactly, that isn't made up for by its advantages?
I see these 'kool-aid' / 'JS is cancer' comments all the time, but they don't come with any real details.
I feel like you've probably never really used JS, if I'm being honest.
- bitL 8y agoKool-aid in the sense that JS is extremely attractive to MBA types that don't have to write anything with it. There is a huge pool of JS developers (quality is questionable but price range is mostly low), browsers run everywhere, Node.js made it possible to run the whole stack on it, so that's a win for MBA types and a great value proposition. The fact that it's a historically atrocious language doesn't matter as they have peasants (i.e. us) to deal with it (to be honest, it got much better since async/await was introduced, but hacks/warts are still there to be abused in horrible ways). I wrote bleeding-edge games and other crazy stuff in JS you might be using right now in your business, so my opinion is not unfounded.
- wiz21c 8y agoBest comment so far
- setquk 8y agoWe're mostly just bitter from years of being beaten with it. I can't actually face using node.js as an example. It is physically painful compared to other options that I have dealt with (flask, asp.net). Also for me, I've been burned before. Do you remember when everyone jumped on the PHP bandwagon? That. Again. Look where we are now. On the web, and now suddenly on the desktop, velocity is not what we need. We need quality and consolidation. Down the line can you see any ES6 based API lasting as long as win32? Hell no. Why would I want to risk building a major capital product on such guarantees?
- dagw 8y agoWhat's wrong with JS, exactly The language has some very ugly warts (although ES6+ fixes many things), I find that the quality/maturity/stability of third party libraries lags behind other languages, and the whole build/dev environment best practices is constantly in flux and breaking things all the time. Also Electron, for all it's advantages, is renowned for being a massive resource hog making what is otherwise a fairly fast and efficient language appear horribly slow at times. That being said, developing in JS today is a lot better than 3-4 years ago, and I suspect that that pattern will continue.
- arghwhat 8y agoI wrote crypto algorithms and protocols, compression algorithms, browser engine sandboxes and similar in JS professionally for 5 years (don't ask why), and often had to deal with fun things like mis-compilations from JS engines and other fun bugs. I'd argue that I have quite extensive knowledge of JS, far beyond the average JS programmer (but far from the highest of experts, of course). JS's only unique, redeeming quality is its availability through the deployment of web browsers, and the benefits that come with such widespread use. JS wins marketshare because it has marketshare. Any language could have taken JS's place, and most would have been better. WebAssembly, when DOM integration and others become a thing, might allow us to throw JS off its throne. JS doesn't have advantages on its own to make of for its disadvantages, and relies heavily on extremely advanced JITs to make it borderline acceptable. The language itself still has very clear signs of having been designed on the back of a used napkin (its number type, its "array of int16's" string, "this", "prototype", ...). I would like to acknowledge that ES2016 brought some things that did remove some retarded areas of JS (like arrow functions, which do not have its own "this" context, unlike the old function expression, class definitions that can briefly make you forget the terrible underlying "prototype" madness, and ways to access proper unicode code points in strings), but we are very far away from having actual advantages here.
- Sammi 8y agoJS has bad parts. That's why there is a popular book called Javascript the Good Parts. So sure old-school JS could be gnarly, but as the book says, you just use a linter and ignore the bad parts, and what you're left with is a very straight forward, clean and practical language. And now with Typescript on top too, we got the wonders of static typing also. What's not to like?
- zippy5 8y agoI think most devs who dislike it because it reduces the barrier to entry which undermines both their own prestige and quality of coworkers. Its similar to dislike of outsourcing in many ways. From a technical perspective, there are couple disadvantages in the long run that can make large codebases unmaintainable. In particular JS and PHP are resistant to static code analysis since they support functions like exec. So it becomes difficult to deprecate functions because the references are not necessarily explicit, thus can lead to tech debt buildup. ES6 does a better job but its backwards compatibility can leave the code vulnerable.
- FridgeSeal 8y ago> I think most devs who dislike it because it reduces the barrier to entry which undermines both their own prestige and quality of coworkers. I think the prestige comment is a bit unfair, but today at work I had to educate a JS dev on what headers are in a HTTP request/request and some other pretty basic things (a dictionary/record type object and a JSON string are not the same thing for one). They were like "I know I've got to do these things, but I don't know why/how they work". So yeah, I don't think disliking it because that's the average quality of JS dev I see is an unreasonable position. I'm sure there's some great ones out there doing impressive things, but I'm sure you could point them towards nearly any language and they'd produce something equally cool.
- bitL 8y ago> produce something equally cool I'd say they'd produce something massively cooler ;-)