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

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



sort by: page size:

> I feel like JS is an expected part of the web

You feel wrong. I enable it when I have to, only.

> How can you build engaging web applications

Not my problem. I want quick loading sites with as few malware vectors as possible.

You should be building web applications which facilitate the transfer of information. You don't need javascript and all the other crap people are using these days for that. I mean, if you're all about pure eye candy and doing..I dunno, mandelbrots or something in the browser, then yeah, you're going to need javascript. But it's not going to work on mobile. Hardly anything like that works on mobile, which is fine by me; I do most of my browsing there.

To be honest, I think there's a market for a firefox addon which removes links to sites which don't work on mobile/require you to have javascript enabled to save me the effort of clicking back when i arrive at am empty page or when the screen is dimmed and all I can see is the corner of some dialog I have no interest in zooming out to look at.


> 1. Hardly any websites work without JavaScript these days.

Got to be that guy: that's a circular argument. Other websites are doing X, hence you should do X too.

It's as much an argument for docs-as-SPA as it's for having a large Outbrain ad with a picture of some skin disease in your docs.

(Disclaimer: I don't hate web apps that don't work without JS — I build them too. But a page of text shouldn't require JS. You can ship the JS-only version as a separate website, but don't force all users to use it)


> how annoying websites are which use Javascript for things which could be done without

A good example of sites which use JavaScript for things they don’t really need are those GP mentions: ‘government sites, e-stores, banking.’

Government sites: the vast majority of government sites are simply informative text. There’s absolutely no need for me to grant the government permission execute code on my computer (which is what JavaScript does) in order to read the minutes of the latest council meeting. Even when interactivity is needed (e.g. an online tax-payment system), HTML forms (the sort we’ve had for over two decades) are a perfectly good solution for ‘enter information in a box and submit it.’ JavaScript can definitely lead to more attractive, more usable solutions — but it’s completely optional. Government sites are a great example of something which should work for anyone, even someone using an old BeOS box on the other end of a modem connexion running over a bit of wet string.

E-stores: there’s simply no need for JavaScript to display pictures & descriptive text of goods in an attractive fashion. There’s simply no need for JavaScript to give me a form to enter my credit card information & mailing address. Again, JavaScript can make the experience better, but it is also a privacy and security risk. I seem to recall that Amazon made quite a lot of money before JavaScript was a thing; I imagine it could continue to do so.

Banking: there’s no need for my bank to execute code on my computer to send me a statement of my accounts, nor to give me a form to pay bills or send money. Indeed, in my experience JavaScript just makes things worse, because instead of downloading a single HTML document from my bank’s servers I get to download dozens of trackers and bugs, as well as the code necessary to hit multiple APIs and stitch the page together out of its parts on my own desktop.

I think I read something yesterday, here or elsewhere, about how client-side JavaScript really took off at the same time as server-side Ruby was a big thing, with the implication that the reason was that Ruby was so slow that websites had to offload as much computation as possible. I don’t know, now, if that was actually the case, but I do know that it’s 2018 and my desktop experience is slower than it was in 1998, thanks to JavaScript.


> try to do as much web browsing as possible in Links2. It's a fast, lean browser with zero support for JavaScript and CSS. The latter means some sites look a bit funky. The former means some sites won't work at all. My usual strategy for sites that won't render without JavaScript is to simply ignore them. If they can't produce something worthwhile without scripting, it's probably not worthwhile at all.

Honestly, I have a huge problem with this mentality even if I can agree with most other stuff. There is a lot of features and apps that are very useful that won't work without javascript. C'mon, this is a really bad point. It is not javascript itself that is bad, it's how people misuse it. Why would native apps be any better? People include tracking and alaytics in those as well and it's just even harder to block / know what actually gets monitored since the application is likely not sandboxed.

I use many apps that require javascript that is really good and privacy motivated. Apps like, Fastmail.com, DI.FM, podd.app etc. I use adblockers and a pihole to take out the worst offenders and tracking scripts.

The solution is not to go back in time and try to convince people to use sites without javascript, that will never work because there is a lot you cannot do without javascript. Drag and drop for example, video conference, photo editing etc etc. There are so many examples of apps that weren't possible before but now is. The web is clearly the best platform to be on since no one company can block you and you can self publish whenever you want. You are in control, not some shitty american company. I have a hard time actually believing that this person never use anything else than that shitty browser. I just don't buy it because the user experience is horrible.

Instead, it's better to lead by example. Build apps that challanges the modern overuse of javascript and tracking / analytics. Don't be the old guy that simply complains how everything was better in the past, you couldn't do shit on the web in the past and now 80%-90% of the applications I use on a daily basis is web based.


>Really, it's hard to see what one truly needs JavaScript for

It's a Turing complete language. You truly need it if you want to do any computation in the browser, modify the DOM, work with Canvas or make asynchronous requests.

Yes, we could all go back to the way the web was in the early 90's when every site was nothing but text and images (and the occasional Java applet) but doing so would also disregard a lot of the very interesting things that javascript allows the web to do as a platform for serving applications as well as documents.

It may be true that most of the web might not absolutely need it, but let's not pretend it serves no valid purpose at all.


> It’s easier, for me, to write websites that require JS.

Why? You can literally just put HTML on a server an start an HTTP server and you're done. How does JavaScript make that easier?

> Why should I spend time on that 1 lonely user who browses with JavaScript disables when I could focus on maximising value for the other 100,000?

Your webpage will be smaller and faster if you just deliver the HTML. I don't know what your website looks like, but it's not uncommon to see 4 MB of JavaScript transferred just to draw 400 bytes of text on my screen.

Moving HTML from your server to my screen is a solved problem, and using JavaScript to do that is just as silly as using Java, Flash, or Silverlight.


> > It turns out it’s useful to have a lingua franca for the web.

> No, I don't think so. Most people do not use JavaScript since it is useful. They use it since it is the only option available on the browser.

Are you not contradicting yourself here? If people use JS only because it's what's on the browser, then it's only because people see value in ... having a lingua franca for the web.


> I am constantly surprised at the number of sites that should be totally static (e.g. a local restaurant's menu page) that display nothing at all when I visit with JavaScript disabled.

I am constantly surprised at the number of people that explicitly disable JavaScript to make their lives difficult in 2018.

My point is, JavaScript makes it easy to build nice websites at scale. Plenty of CMS platforms (like Wix.com) use JavaScript by default.

If 99.9999999% of people are fine with JavaScript, then why should a website cater to your need by providing a version specific to people who disable JavaScript?


>Are y’all browsing the internet like this? If so how and why? Isn’t most of the modern web dependent on JavaScript?

It's not all or nothing. I enable JS for the bank, webmail, etc websites I visit regularly and trust. There's no need to have it enabled on the rest of the shit that I only visit when it gets linked on HN.


>If you're building a client-side application rather than just a web page, then it's okay if turning JS off breaks your app.

I wouldn't even say that this was necessarily true. Client side applications that can be made perfectly functional without JS should be made functional with JS.

I don't want my online banking website or my tax return web apps to use javascript at all. They do, though.

The fact that people make blogs, whose only real function is to serve static text, render with javascript is nuts.


> Anybody claiming they regularly use the internet with JS disabled is just lying for some sort of feel of superiority.

Nope. I do, and I'm not lying. I started because it was required for my work and I just got used to it and now do it everywhere. The internet with NoScript is the best way to browse 90% of the time.

Even today, the vast majority of the sites I visit (including the one linked to in this post) work just fine (for what I want) without JS. That means the text I clicked to read is displayed and is readable, the images I clicked to view are displayed, etc. Other parts of the site may not work (menus for example), but if I'm just following a link to an article I want to read and I can read it without javascript why do I care if the menus on the site are broken or if i can't leave a comment?

For the sites I regularly visit that really do need JS I enable only the JS files needed to accomplish the things that I want and that's only necessary to do one time for each site where that's needed at all. NoScript remembers my preferences on each domain.

For those rare occasions I actually need to enable JS to get the functionality I want on a site I'm visiting only once I can just temp allow only the scripts I need to get the content I want and the next time I close by browser (or clear those temp permissions by hand) that site is no longer allowed to use JS. Ill admit that for some random sites I wasn't that interested in in the first place, there are times where I'll still just close the tab and move on.

I really don't understand why people think it's so hard to use the web with NoScript. Overall, websites load much faster and look cleaner without JS and I'm much much more secure. Most of the time, it's really not a problem.

I will say, I do have an add-on called NukeAnything that lets you right click and remove whatever you want from webpages (only until the page is reloaded) and that occasionally does help fix some issues for sites that don't handle the lack of JS gracefully. If somebody's poorly designed JS heavy menu is spewed all over the page and covering the content I want to see, I can just right click and remove it. Same with obnoxious "we use cookies" banners that I refuse to interact with.

Honesty it's the other things I've done to harden the browser (disabling redirects, service workers, WebGL, WebRTC, Wasm, location sharing, DRM, plugins, cookies, web storage, etc.) that cause the most problems with sites, and I do keep another unhardened browser around (brave atm) to handle the sites I absolutely need to access that depend on that junk.


> A website that requires JavaScript is, and always will be, worse than one that accomplishes the same without JavaScript.

Are users happy? Is dev speed of improvement good enough? Can you onboard new devs easily enough?

That’s it. Nobody cares if you used CSS or JS for a toggle switch.

The only people who disable JavaScript in their browsers and expect the 2023 internet to accommodate them are right here in this thread.

Just componentize it and move on to solving the next business problem, not the next code elegance problem.


> The web IS javascript driven

I think the idea that you need Javascript to drive a page designed to show an article consisting of text and images is probably worth questioning. Maybe you do, I don't know. But I think you should at least think about instead of falling back on the idea that the web is Javascript-driven.

You (probably) won't be benefiting the people without Javascript because hopefully your page works for them anyway. (Astoundingly, some simple article-type pages do not.) You will be benefiting yourself and almost all users because, without JS, your site will load faster and (often as not on really JS-heavy websites) scroll faster.

If you're creating a webapp, sure, you'd be crazy not to use Javascript.

But it's insane that Internet comment threads or text-based articles can drive yy i7 to 100% usage.


> In practice, it seems to me to be more of a religious taxonomy than a technical one, based on the belief that the modern web has become tainted by complexity and needs to be made pure again.

I see it more being whether a page uses progressive enhancement. If I can disable JavaScript and at least be able to read a page's content, then its a web page rather than an app. If JavaScript is an absolute requirement for any functionality it's an app.

A page with some client-side form validation, AJAX submissions, or even just some dynamic content are awesome uses of JavaScript so long as the pages themselves don't hinge on me running the JavaScript. Posting a comment might be a POST and clicking an image thumbnail might load it in a new tab instead of a light box. The functionality is all still there if for any reason the JavaScript doesn't load.

One of my big problems with "apps" is they have zero provisions for JavaScript not running. Most "apps" don't even give an error page telling you explicitly JavaScript is required. Even when you have JavaScript enabled they tend to break in stupid ways if you've got an ad blocker.


>Unfortunately there are cases where currently users are assuming that JavaScript is not necessary but is.

There are? I've never heard of that happening. The author should provide some kind of empirical evidence on the prevalence of that problem.

>It's a great day for a web developer when we can finally assume that a browser will have JavaScript running.

You can assume that without removing the option to disable JavaScript. In addition, technical users (the only one's who are disabling JavaScript) can still disable JavaScript using add-ons or using other browsers.


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


> Most web apps I work with daily have highly sophisticated in-browser interactions that are built with JavaScript and can only be built with JavaScript: Flickr, YouTube, Facebook, Twitter, GMail etc.

Highly sophisticated browser interactions? You mean adding a comment? Which you actually just did on Hacker news using zero javascript.

None of those sites need or require a lot of Javascript. In fact, when I use Gmail I have the standard html version set to default. It's much faster and time to inbox is faster.


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


> I feel like JS is an expected part of the web just like HTML and CSS. How can you build engaging web applications if you are not even allowed to rely on standards like JS (e.g. if the user turns off JS)?

The web is not about 'engaging web applications'; the web is about webs of interlinked documents. Every time you require JavaScript to display a simple document; every time you load images with JavaScript instead of <img>; every time you replace an <a href=> link with a JavaScript event handler; every time you fail to even link to a page; every time you use JavaScript-loaded fonts to display symbols: you break the web.

'Web application' is a misnomer: it should be 'browser application.' Despite my loathing for documents (e.g. blogs, articles &c.) which require code execution in order to be read, I don't mind browser apps where they make sense. Google Maps makes sense: it doesn't bother me that it doesn't work in eww, or links, or with NoScript.

Blogger doesn't make sense: there's absolutely no legitimate reason for it to show an empty page with JavaScript turned off: Blogger is breaking the web. imgurl's failure to show all images, and Cracked's failure to show any images, without JavaScript makes no sense: they are breaking the web.

People who break the web should be deeply ashamed.

next

Legal | privacy