6 ms·
>> Despite my general distaste for JS largely due to websites tending to abuse it more than anything Why would you have a distaste for JavaScript based on how
by andrewstuart 7y ago
>> Despite my general distaste for JS largely due to websites tending to abuse it more than anything
Why would you have a distaste for JavaScript based on how others use it? JavaScript has evolved into an extremely powerful and flexible language which is taking many great lessons from other languages. Sure its not perfect but its a real workhorse.
EDIT: I know you're not meant to ask why the downvotes, but I do wonder in this case - the comment is a reasonable one, I guess it's the many JavaScript haters piling on - "Haters gonna hate". I stand by these comments - JavaScript is a flawed but great language that has only proven over time its flexibility and adaptability to become probably the single most used language - the people who don't like it are those who don't use it/understand it.
- _pmf_ 7y ago> I stand by these comments - JavaScript is a flawed but great language I like my languages a bit less flawed, thank you very much.
- schwartzworld 7y agoWhich languages would those be?
- smt88 7y ago> Why would you have a distaste for JavaScript based on how others use it? Languages don't exist in a vacuum. The way libraries are written and the way coworkers write code has a huge effect on us. > proven over time its flexibility and adaptability to become probably the single most used language Its usage has nothing to do with its quality. The web has a low barrier to entry, and well web devs have to use JS because browsers handcuff us to it. If JS were so great, we wouldn't have increasing TypeScript adoption or a million compile-to-JS languages. I've been writing JS for 20 years. I use bleeding-edge features, TypeScript, and Babel. I've done front and back end. It still sucks (which is sometimes the fault of V8, but not always).
- schwartzworld 7y ago"If JS were so great, we wouldn't have increasing TypeScript adoption or a million compile-to-JS languages." That's quite the leap. Plenty of people like writing plain JS. Your only argument for why "it sucks" is basically "because some other people made tools that they thought were better." What's one language that doesn't fit that? Python sucks too https://github.com/vindarel/languages-that-compile-to-python https://github.com/vindarel/languages-that-compile-to-python C sucks too https://github.com/andrei-markeev/ts2c https://github.com/andrei-markeev/ts2c Rust sucks too http://rusthon.github.io/Rusthon/ http://rusthon.github.io/Rusthon/ The real reason people talk about JS being bad is because "circle jerk" and "reasons".
- userbinator 7y agoThe amount of JS I come across on sites that is purely superfluous and serves to irritate, manipulate, or simply waste resources far outnumbers the actually useful, efficient, and purposeful use of it in webapps. I'm talking about things like loading several MB of it with half a dozen frameworks and libraries, just to render a few KB of text. Don't even get me started on popups/popunders/popins/clickjacking/scrolljacking/historyjacking and all that other crap that JS gets used for far more often. Observe that Bellard's own site, despite having a few JS-based projects and demos, and now himself being the author of a JS engine, has not succumbed to the "JS everything!!!1" fad. (FYI I didn't downvote.)
- Accacin 7y agoOk, so this comment is so cliche it's getting hard to ignore. Yes, JavaScript is abused but the problem is that people by large enjoy these types of site. I've never heard my parents or non-developer friends complain about a site using too much JavaScript, but if I show them Hacker News or old.reddit.com, they'll complain it looks ugly and hard to read/use and really do lose interest in it immediately. Anyway, I fail to see how this is a problem of JavaScript. Replace JavaScript with any other language in the browser and you'll see exactly the same abuse happen. If you really dislike JS so much, do what I do and disable JavaScript in the browser. If a site doesn't work I don't use it. People on Hacker News seem to want the web to revolve around themselves but it never has done and never will.
- tluyben2 7y ago> I've never heard my parents or non-developer friends complain about a site using too much JavaScript How can they? They don't know what it is. They are complaining about it a lot of times you don't hear about it; every time they have to fill an abomination of a form, every time they hard-close their browser because it's stuck, every time they just wait for a page to load, every time 'something' happens they did not ask for but it happened anyway. That's not the fault of JS but it is the problem of the ecosystem, the ease of use etc. Messing things up and 'good enough' are very popular things it seems. The thing is that, on the internet, good enough can go wrong in many ways. And the ways it does just tired people out in reporting it. Besides the billion $ sites (and still there , but less), there are so many bugs in the average website; we just ignore them and start over or go somewhere else because it's just not worth burning your energy on; no-one is going to change. And a lot of that is broken JS. Again, not the fault of the language JavaScript, but of the fast and loose usage of the language. Anecdotally, but I am sure this resonates with people who sometimes do not order only from Amazon, I tried to order some impossible meat from a site here and when it was time to pay, there was a JS undefined error and it emptied my shopping cart. This happens a billion times a day all over the place. JavaScript is vilified by 'the elite' because of it and that's unfair, but the ecosystem promotes it. Everyone is focused on 'process' (CI, deployment, many irrelevant unit tests; a lot of busy work basically) and 'beautiful code' (style, linting, things a beautifier can do for you automatically) and ego (github stars), but robustness or longevity is just not really a focus of many.
- _bxg1 7y ago> I know you're not meant to ask why the downvotes, but I do wonder in this case I'm not a JavaScript hater - these days it's my main language - but your comment was pedantic and interpreted his words uncharitably. By "distaste for JS" he clearly just meant vague negative emotions surrounding it, not that he thinks it's an invalid language. He even specifically says his distaste is circumstantial.
- root_axis 7y agoJS is the new PHP. It's really popular (i.e. lots of n00bs) and not at all elegant, so the programmer elite regard it with derision. I also notice people often conflate the problems of overzealous browser-based scripting with JavaScript the programming language. This is pretty understandable since JavaScript has been the only browser scripting option for 2 decades, but those problems would exist no matter what options were available for browser scripting. It's a safe bet to assume that the problems would actually be much worse if JavaScript wasn't the only browser scripting language available since that would mean browser-based scripting would be more accessible to more programmers. In another 6-8 years when WASM targeting alternatives become more mature we will see a new explosion of browser scripting.
- nwmcsween 7y ago> not at all elegant, so the programmer elite regard it with derision Having both programmed PHP and Javascript extensively, PHP when it was first designed was absolute junk, functions were bucketed by strlen. Javascript at least had some semblance of sanity even with the wonky comparison mess and ===.
- tuesdayrain 7y ago> JS is the new PHP. It's really popular (i.e. lots of n00bs) and not at all elegant, so the programmer elite regard it with derision. I would love to find a language I consider more elegant than modern JS/TS. Haven't seen anything yet though. I also question your claim that it's the "elite" who regard JS with derision. Fabrice is presumably fine with it considering he spent valuable time writing an engine for it.
- root_axis 7y agoI don't think JS/TS is that bad, but it's certainly pretty far from elegant. TS adds decent type support which helps tamp down on dynamic complexity but rust, go, kotlin, c#, swift, ocml even java are all much more elegant languages. I realize that elegance is largely subjective so I won't belabor the point, but it's a pretty widely accepted subjective assessment.
- 7y ago
- egeozcan 7y agoThe comment you are replying to gives the reason of disliking the abuse, to weaken the point on the dislike of Javascript, not to fortify it.
- draw_down 7y agoRight, people here wouldn’t accept that reasoning for any other language.