Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

> why do you need to bash people enjoying themselves with a tool they're comfortable with to create things

Isn't that part of the theme of the post? Javascript doesn't care that it's being used for evil, but the things people create in Javascript often turn that way. They harvest personal data, drain battery life, and litter the internet with obtrusive advertisements. And that's when it doesn't just fail and break the website.

So go ahead. Create kind and beautiful things in Javascript. Just don't be surprised that people blame the language for the dreadful things it's brought us.



sort by: page size:

> Javascript is not evil

We-e-ell, it's not a good language. But it's what we have.

I agree, though, that it can be used well and does have a place in writing good web pages and sites, but that when it is used to create horrible 'web apps' it is being used for evil.


>As a person who writes a lot of JavaScript and (mostly) enjoys it, this makes me sad because while I enjoy the interactivity it provides, I must concede that big data companies and advertisers have weaponized it against us.

I could not agree more. I have started browsing the web with JS turned off by default in all of my browsers (desktop, laptop and mobile) over the last few months. I've never been happier. Especially on mobile. The web has become a bloated, unusable mess.


> I develop HTML5 gambling for a living and this anti-javascript sentiment on HN is getting really tiresome.

I've been using websites since the early 90s and this pro-single-page sentiment is getting really tiresome. You are breaking the web. You are destroying users' security.

Sure, there are plenty of reasons to use JavaScript, and plenty of places where it's appropriate. It probably is a good idea for games and so forth. But requiring users to load and execute constantly-changing code from across the web in order to read a page or submit a form is in-friggin-sane.

Some one else pointed out that it'd be nice if browsers offered more support for things that certain types of developers clearly want to do. I completely agree; it'd definitely be nice to take advantage of many of the technologies which currently exist to do more, in a more structured way. But requiring code execution in order to read data is madness.


> People still disable JS in 2016? I take it that 80%+ of the web is horribly broken for you guys.

Yeah, it is — but it's better to have to enable JavaScript on a one-by-one basis when desired that to travel across the Internet executing random code and impairing one's privacy.

Some websites require JavaScript to display images nowadays. What's wrong with <img>? Others require JavaScript to use the correct font. What's wrong with CSS? Still others require JavaScript to show text. What's wrong with HTML? Still others require JavaScript to build links. What's wrong with <a>?

JavaScript is destroying the Web. What was a powerful technology for disseminating formatted text across the world has become a cobbled-together GUI held together with baling wire and twine.


> Hey can you give what is the rationale behind the JS hate?

JS has its overhead in terms of data and, more severly, performance. Many people tend to put unecessary JS stuff like custom scrolling, needless animations and needless interactivity, etc. This stuff more often than not just ends up getting in the way of normal browser function and is of questionable benefit or none at all.

> I am building a website that relies heavily on JS. What should I be aware to steer away from the JS hate?

Don't add any JS interactivity that only makes a website "look cooler"* and that's not actually critical to your website's functioning. For example, stuff like google maps needs javascript. Stuff like blog most likely doesn't.

Remember to try out how your website works on a device with weak hardware and slow connection. This will not only make it far more accessible for people with older hardware, it will make better for recent hardware as well.

*) today's expression would probably be "rich user experince" or somesuch, but the meaning is the same - it's just vanity


> so much of the javascript out there just does things you don't want

JavaScript developers should ask themselves if they want JS to become the popup of the 2010s: initially well-intentioned, shamelessly abused, universally loathed, and ultimately killed.


> most users actually prefer visually fancier content with pictures and colors.

You're aware that pure HTML and CSS alone can produce visually fancy content with pictures and colors, right? It honestly seems like a lot of web developers are starting to forget this, but it's true, I swear. My personal web site (https://coyotetracks.org/) is minimalist by design, but it has accent colors, custom fonts, Retina-ready images, and that silly little fade in and out when you hover over links, all without any JavaScript whatsoever. Also: turns out it works pretty well on Lynx!

I think JS gets a bit of a bad rap these days and am willing to leap to its defense even though I don't like it much as a language, but a huge chunk of the reason it has a bad rap is because people do bad things with it, by which I mean either malicious things or just unnecessary things. An awful lot of modern web sites could run just fine with far, far fewer scripts than they're deploying.

(And, yes, I can even do web analytics without JavaScript, because there are these things called "server logs" I can analyze with utilities like GoAccess.)


> Essentially, users do not really benefit from the use of JavaScript, but websites do, and they do so mightily!

Bullshit. Lots of features that are essential in people's everyday use case need Javascript in the web.

> 4. Websites that Require JavaScript. When I encounter a website that absolutely requires JavaScript to function so conditioned are my reflexes that I find I've backed out and off it without me even having realizing it. I can wiz through dozens and dozens of news items on Hacker News and easily bypass any sites that will not function without JS. I've never needed to worry, as on the Web there's always thousands of equivalent or alternative websites that are more 'cooperative' from which to choose.

Good for you for who's use is just for browsing in HN. As for most people there who use it for work and personal reasons, I am glad Javascript is there to provide features that are not possible without it.

> 5. In very rare instances when I must visit a site that requires JavaScript to function, I've a browser add-on that has an icon on the navigation toolbar which allows me to simply toggle JS on and off whenever required. Accidentally leaving JS on is almost impossible as the icon changes from green to red when off. Similar methodologies apply on my rooted smartphone: along with the absolute prerequisite of completely removing (deleting) Google's GApps, the 3rd-party browser I use has a feature to turn JavaScript quickly off

Guess what language that browser add-on you are using is written in.

> In a much more user-centric web environment, none of us users would ever need this JavaScript 'junk'.

In a user-centric environment, we put people needs first. So having a language that empowers developers to put features that are useful to the user is the primary focus. If you want to create JS less websites, you STILL can do so.

I understand that Javascript has much to improve. But your hatred for it borders on the idealogical.


> It is not Javascript per se, but the so-called "modern" browser that creates problems for so many users.

I think that it's both-and, not either-or. JavaScript itself is a terrible, horrible, no-good language; the modern browser environment is also a terrible, horrible, no-good invasion of privacy and destruction of security.

I do not believe that there is any purpose for which JavaScript is a suitable language (absent considerations of popularity, e.g. as on the web browser), although I could be wrong and am open to counterexamples.


> Unbelievable. Now we're to be angry at (or at least, suspicious of) Eich for inventing Javascript? Because... it can used for evil? Is that really a path we should be going down? Is Tim Berners-Lee next? Come on.

There is literally no good case for JavaScript. It's literally malware: code that runs on your machine without your explicitly installing it and does things that serves the website, not the user. The fact that it's in a sandbox to limit the harm it can cause is nice, but it doesn't really solve the fundamental problem.

Formats such as social media profiles, recipes, etc., would have been better served as document formats separate from or included in HTML.

More complex things like Google Maps could have been done as native apps--and still are, because the web app simply can't provide the same level of experience as a native app.

> They started trying to solve the problem of facilitating an advertising model that respects privacy and rewarding creators (users) with revenue in the form of BAT tokens.

If I want to reward a creator I can pay them without a middle man: BAT complicates that rather than simplifying it.

Advertising is a social harm. An advertising model that respects privacy, still disrespects attention, bandwidth, power usage, etc.

It should be clear that content creators aren't browser's target users, but since you brought it up: advertising generally creates a race to the bottom which incentivizes low-quality, low-effort content creation which creates a filtering problem: now it's hard to find the high-quality content amid the half-assed AI-generated nonsense. Publications which are high enough quality to be paid for, such as the NYT, have obviously been harmed by ad-based business models becoming the norm.

> Say what you want about the execution, or the idea in general — but it's a noble goal.

Their goal is to make money, and they've set it up so that their goal of making money is dependent on pleasing advertisers, not users.

The noble goals you're claiming simply are not true.


> 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.


> IMO we should be breaking JavaScript more often, especially in the name of performance, to make people use less JS and simpler JS on their websites.

Though not by pushing it down people's throats in a backwards-incompatible way.


>> And my biggest surprise is how Javascript turned from one of the most hated programming language ( besides PHP ? ) into being acceptable and loved.

For real?

I personally think JavaScript is awesome.

I personally think jQuery is awesome.

And I feel really alone a lot of the time in these opinions. I see a lot of disdain for JS here in comments in particular.

I also see a lot of people browsing with JS disabled, and who complain when a site doesn't function without it.


> According to this article we should accept

Well, I wrote the article, so I can say with some authority that you've badly misinterpreted it! Somehow I manage to build sites with exceptional performance that are snappier than the equivalent JS-free sites, using the techniques I talk about (and https://svelte.dev).

Yes, there are a lot of bad sites out there that abuse JavaScript. No, that doesn't invalidate the article's thesis; it supports it.


>I don't fully understand why packages like this are so popular.

I consider 'iseven' and 'isodd' to be signs that Javascript is a hellaciously engineered piece of crap that should be avoided at all costs. They're popular because Javascript is garbage.


>> Web devs should make sites that work without javascript, so that turning on NoScript is also a solution.

> Sorry but this is a ridiculous statement, it's like saying websites should still be able to run on Gopher.

Sorry, but your statement is ridiculous. Unless the website is an application, that is, it does something useful, it's just bunch of text and images. You should not expect people to give you full Turing capability just because you're too full of your awesomeness that you can write a program.


> I genuinely don't understand this hostile statement. Why do you complain that a website isn't functional in pure html in 2017?

Because sites that rely on javascript typically have terrible performance and broken UI, and add insult to injury by not doing anything that actually needed javascript in the first place.


>I’m a firm believer that the web should be usable with JavaScript disabled, JavaScript is there to add a layer of interactivity to your web page, not core function. All those people that keep coming up to me quoting ‘but everyone has JavaScript enabled’ miss the point - the web needs to be accessible and JavaScript isn't the answer.

Accessible to who? Because most real life screen readers and such perform quite well in actual tests with JS pages.

>JavaScript is there to add a layer of interactivity to your web page, not core function.

Again, says who? Why should I have to write my web code with twice as much effort, once with all the nice things I can do with JS and another for the 1% of users without Javascript?


> I notice a lot of hate toward JS, but honestly when I first stumbled upon it I felt like a dream came true; it gives you the power to create experiences and share them almost effortlessly

The complaints about JS are almost never about the concept of a programming language that runs in your browser, and the upside you describe seems to apply to any language that runs in your browser.

next

Legal | privacy