News for hackers. Stuff that matters.
Re:A day without JavaScript by linkmotif on Wednesday June 07, 2017 @09:32AM (#14506258)
I simply will not spend time tailoring a nascent or even mature product to 0.0001% or whatever minscule percentage of the population turns off JS. If you turn off JS, you get a blank screen. Why should I accommodate your cohort? Why write unit tests for someone who takes a standardish client with above 1% market share and does something completely unstandard with it?
Re:A day without JavaScript by always_good on Wednesday June 07, 2017 @10:31AM (#14506715)
I find that it's at least (usually more) double the work to build the JS-free version of something for a fraction of the user experience.

For example, imagine a forum where clicking the "edit post" button turns your post into a <textarea> editor and saves with AJAX so that you can continue scrolling once you make your edit.

To build the JS-free version, you typically need a separate endpoint, a new template, a redirect, and a less empowering editor. And all this for UI that 99% of your users won't see.

It just doesn't seem like a opportunity cost savvy way to build a website.

Then there are the UIs that take some real backsplits to accomplish without Javascript like a table that lets you mass-modify the rows with checkboxes and a <select> at the top that lets you choose options like Move | Archive | Delete.

You can wrap the entire <table> with a <form> such that all of your checkboxes submit to your mass-modify endpoint. That works without JS.

But since you can't nest <form> within other <form>, your <form method="DELETE" action="/things/{id}"> delete buttons can't appear in each row.

I have a hard time understanding how so many people in these threads can suggest that the opportunity cost of building for the 1% is always worth it. Does everyone just have basic blogs on the mind when they envision the labor involved in what they preach?

Re:A day without JavaScript by syrrim on Wednesday June 07, 2017 @12:13PM (#14507563)
Non js users aren't expecting the website to work perfectly without scripts on. The bare minimum they ask for is that the site can be read without using scripts. Obviously it would be nice if all the moving components didn't need scripts either, but most people can accept that this is too much work.
Re:A day without JavaScript by SquareWheel on Wednesday June 07, 2017 @01:20PM (#14508123)
Depending on the site, even just reading may be problematic. Imagine a webapp where all data is requested and sent as small JSON updates. This is faster and it's less data than full page copies, and can be more targeted to that user.

To build this feature for the tiny fraction of non-JS users, you're looking at duplicating all of this functionality on the server. This greatly increases dev time and complexity of the codebase. It means moving from an entirely API-driven platform to one where your server needs to understand the app logic as well.

Like it or hate it, Javascript is a web standard. You know that websites will break if you disable CSS -- the expectation should be the same for disabling Javascript.

Re:A day without JavaScript by perilunar on Thursday June 08, 2017 @03:23AM (#14512527)
Websites shouldn't break if you disable CSS - just look worse. The text should still be perfectly readable and images viewable.
Re:A day without JavaScript by SquareWheel on Thursday June 08, 2017 @12:54PM (#14515422)
That's an unreasonable expectation. Many websites have complex content and layouts, and no web designer will build their site to gracefully fall back with CSS disabled. That just doesn't happen.
Re:A day without JavaScript by perilunar on Thursday June 08, 2017 @09:21PM (#14518534)
It does happen when the developer cares to do it; I know several that do.

Website layouts need to be made linear (single column) for display on mobile and the content order usually reflects that anyway. They also need to make sense when using screen readers.

Disabling CSS and checking the result gives you a quick sanity test that the content order makes sense and that the markup is used somewhat correctly. It won't be pretty, but it should be useable.

Re:A day without JavaScript by ams6110 on Wednesday June 07, 2017 @11:07AM (#14507032)
For me, yes. I should be able to see at least the main content of your blog without JS. I don't care if it's perfectly formatted or styled. Just put the text in a div.

When I go to a blog post linked from HN and see a white empty page I will just move on.

Re:A day without JavaScript by horsawlarway on Wednesday June 07, 2017 @05:17PM (#14509955)
Good. Please leave. I don't walk into a restaurant and demand that they cook my food without using a knife. Don't expect modern websites to bend over backwards for a (frankly rather juvenile) view of a modern web standard.

Code execution is part of the web, it's here to stay, the number of sites that support non-JS experiences will continue to dwindle.

You're not some special snowflake. Other people make real decisions based on cost/value models, and you cost way more than you're worth.

Re:A day without JavaScript by flukus on Wednesday June 07, 2017 @08:38PM (#14511033)
Where does the cost of making a blog readable without javascript com from? It takes a lot of extra effort to make a blog that requires javascript.

As far as I'm concerned, if it's not readable without javascript then you've got nothing intelligent to say anyway.

Re:A day without JavaScript by horsawlarway on Thursday June 08, 2017 @11:53AM (#14515034)
>As far as I'm concerned, if it's not readable without javascript then you've got nothing intelligent to say anyway.

Great! Leave please. I have no desire to interact with folks who approach the world in that manner.

Re:A day without JavaScript by qudat on Wednesday June 07, 2017 @11:58PM (#14511826)
A blog post is one thing, but many web developers that venture onto this site -- myself included -- are building complex web applications that would simply not make any sense as a "read only" website.

You are more than welcome to disable JS, but the number of web developers that I've met that actually care about a non-JS user experience is next to zero.

Re:A day without JavaScript by majewsky on Wednesday June 07, 2017 @11:45AM (#14507330)
> But since you can't nest <form> within other <form>, your <form method="DELETE" action="/things/{id}"> delete buttons can't appear in each row.

Of course they can. The <form> action submits via POST to an endpoint that disambiguates the selected action, and forwards inside the server side to the appropriate endpoint. Shouldn't be hard with a competent framework.

Then, when JS is enabled, you override the click action on the action buttons, so that the <form> action never gets used.

Re:A day without JavaScript by qudat on Thursday June 08, 2017 @12:02AM (#14511841)
When you add up all of the ridiculous hoops web developers have to jump through for cross-browser compatibility, a non-JS UX is the least of their concerns.

You're asking web developers to come up with two methods to accomplish the same goal, which doubles the number of ways the app can break. It's totally unrealistic for any moderately complex web application.

Re:A day without JavaScript by 52-6F-62 on Wednesday June 07, 2017 @10:49AM (#14506883)
I agree almost fully.

I think it depends on the user demographic. If you're actively developing a service that you hope to be used even in the most deprived areas with outdated equipment and poor connections, then it may be worth it. For example, outreach programs, charities, and emergency services.

If you're developing something that is more or less a needless, but useful, product -- your demographic is more than likely the upper 30% of earners in the world... yeah, probably not worth your time to develop for that 1% who won't be using JS (or have the capacity for only older versions).

Re:A day without JavaScript by devrandomguy on Wednesday June 07, 2017 @12:02PM (#14507466)
In my experience, optimizing for perceived latency (time between user request sent and site becoming usable) inevitably leads to server side rendering, in geographically distributed availability zones. If you know this in advance, then you can choose to use tools that support code reuse across the client/server divide. This way, SSR is mostly a one time cost, and it can be implemented at the very beginning of the project, while everything is still nice and simple. It does impose additional constraints during UI development, but many of those are good practices anyway (proper use of HTML elements, prefer native form elements to fully custom inputs, use URL and history to manage state, etc).

It has been somewhat humbling to watch users on low speed connections use the app before the JS finishes loading; it shows everyone the true value (or lack thereof, for the passive content consumers who make up ~98% of the visitors) of the JS portion of the app, since they see it with and without JS. Sure, they can't drag a box on my fancy visualization, but they can see a snapshot of it, and use the peripheral controls as links to navigate to the desired application state. Then, as they are reading something that is useful to them, the ~2mb JS blob slips in and quietly brings the application to life.

Also, I love the way the 3rd party JS blobs that management mandated, are so obviously slower than the rest of the page. This gives me good ammunition for the arguments where I demand an HTTP API, not a JS blob, from our partners. They hate that, because then they can't stuff their own trackers into our clients. Fork 'em.

Re:A day without JavaScript by josefx on Wednesday June 07, 2017 @10:53AM (#14506909)
I use NoScript. If a site interests me I unblock it, I may also unblock one or two external scripts. What I encounter quite commonly is a list of 40 external scripts, which results in a closed tab. There is reasonable use of JavaScript and then there are web devs. playing gotta catch them all with tracking scripts and, at the risk of repeating myself, social media integration.
Re:A day without JavaScript by thinkxl on Wednesday June 07, 2017 @10:19AM (#14506622)
> For the same reason we build features in websites that work for blind people (aria tags everywhere), disabled people (accessible buttons), people who speak different languages (i18n), VIM users (GMail keyboard shortcuts), etc.

From a comment below.

Re:A day without JavaScript by linkmotif on Wednesday June 07, 2017 @10:26AM (#14506672)
Great counter example, thank you. Accompdating people with disabilities is totally worth it though imo, as an example of a very minor cohort that's not all about percentages.
Re:A day without JavaScript by lokedhs on Thursday June 08, 2017 @07:46AM (#14513419)
I use Vimium in Chrome to be able to use the keyboard to navigate web pages. Gmail in particular conflicts with this by implementing its own keyboard shortcuts that interfere with my workflow.

Some people may like it, but I'm just saying that it's not a feature that isn't disliked by some people.

Re:A day without JavaScript by 52-6F-62 on Wednesday June 07, 2017 @10:50AM (#14506889)
Agreed. Before reading further down I commented on another response with a similar message.
Re:A day without JavaScript by ploxiln on Wednesday June 07, 2017 @02:00PM (#14508504)
Supporting a JS-disabled experience should not be your first priority. But, reducing needless reliance on javascript will improve your site for every user - making the page load / respond faster, use less CPU and memory, etc. It will also improve the development experience for you - faster to test, less crazy codebase to work in. It's really just architecting the site better.

Some people are so scared of "premature optimization" and "catering to a tiny number of geeks" that they trick themselves into making a huge JS mess. Most websites these days seem to be examples of this.

Re:A day without JavaScript by fenwick67 on Wednesday June 07, 2017 @02:14PM (#14508602)
It really depends on your pages.

If you are building a blog or a news site (a classic "content" site), it should absolutely work without javascript.

If you are building an admin interface for said news site, where articles are edited and published, it is okay to require javascript.

Re:A day without JavaScript by qwtel on Wednesday June 07, 2017 @10:08AM (#14506534)
because its good engineering. you don't know what might break your JS in the future. you also don't know which user agents people will use in the future. I was quite surprised to discover that some "UC browser for Android" had quietly racked up a 9% usage[^1]. UC doesn't come without JS, but has a limited feature set, and without feature testing there's a good chance it will break your site. It broke [mine](https://qwtel.com/hydejack/), if it wasn't for feature testing and serving vanilla HTML. Also, and I know it seems impossible, but sometimes programmers ship broken code. Again, not relying on JS gives you safety net to fall back on.

[^1]: http://caniuse.com/usage-table

Re:A day without JavaScript by linkmotif on Wednesday June 07, 2017 @10:17AM (#14506609)
Nonsense. This is definitively YAGNI. Good engineering is accommodating the greatest number of people with the resources you have in the least amount of time. Thinking about some abstract future scenario is categorically not good engineering.
Re:A day without JavaScript by throwaway47861 on Wednesday June 07, 2017 @10:52AM (#14506904)
You misspelled "good bean-counting". Good engineering requires you to cover for everything you can.

Case in point: car seatbelts and airbags. Most people don't crash, right? But you aren't seeing the car manufacturers remove seatbelts and airbags.

Re:A day without JavaScript by postozoan on Wednesday June 07, 2017 @05:37PM (#14510064)
You also don't see car manufacturers change their designs so that they will accommodate drivers who've decided to remove their steering wheel, nor do car manufacturers design their cars for some possible future world without gasoline.
Re:A day without JavaScript by throwaway47861 on Thursday June 08, 2017 @10:13AM (#14514284)
I've had this one coming. Serves me right to believe contrived example won't be nitpicked. :D
Re:A day without JavaScript by to3m on Wednesday June 07, 2017 @11:02AM (#14506992)
When everything is made from beans, the bean supply must be kept in mind.
Re:A day without JavaScript by Brockenstein on Wednesday June 07, 2017 @02:59PM (#14508962)
Consumers by in large know driving is dangerous and safety features are something car manufacturers advertise to consumers. Not to mention over the last 30-40 years drivers have come to expect these sorts of features in cars because accidents happens and those features increase survivability, by a lot.

The same sort of consumer expectation doesn't exist for no-javascript. Major browsers default it enabled. The web has developed to be seriously built on top of javascript for the last 15 years. Consumers have expectations for how the web should work in 2017 (for better or worse) and no-javascript isn't anywhere on the radar.

Consumer expect cars to have airbags and seatbelts, consumers expect websites to behave as they always have and that means javascript.

Re:A day without JavaScript by throwaway47861 on Thursday June 08, 2017 @10:12AM (#14514274)
JS is necessary. But what do we do about the extensive tracking and extremely unoptimal requests, for which we already have numerous articles out there?

If there's no soft solution, disabling JS altogether is a good fish net for a lot of people -- yes the percent is close to a rounding error but the absolute amount can go to 1 million or more.

Re:A day without JavaScript by sbov on Wednesday June 07, 2017 @11:28AM (#14507204)
Counter point: many cars aren't made to accommodate people as tall as a professional basketball player. Should I call them all bad (or at least not good) engineering?
Re:A day without JavaScript by throwaway47861 on Wednesday June 07, 2017 @11:45AM (#14507336)
Counter-counter-point: I am above 180cm (far from 200+ where many basketball players are) and many taxis aren't tuned for me and I bang my head on the ceiling so yes, I definitely call the manufacturers of those cars bad.

Statistical averages are a back-patting technique between managers, let's face that reality, shall we? They very rarely have the customer's interests in mind.

Re:A day without JavaScript by RussianCow on Wednesday June 07, 2017 @04:45PM (#14509719)
You have to draw a line somewhere, though. Every engineering decision has a cost, whether time/money, opportunity cost, or design tradeoffs, so it's not practical to cater to every single user you have.
Re:A day without JavaScript by throwaway47861 on Thursday June 08, 2017 @10:07AM (#14514251)
There are many people above 180cm.

Again, let's face it -- it's bean counting, some medium-level product manager wants a raise by saving expenses.

That's all it is, that's all it ever was, and it ain't ever gonna change while there are people on these positions.

Re:A day without JavaScript by jholman on Thursday June 08, 2017 @12:59AM (#14511994)
Good engineering requires good bean-counting. Figuring out what you can do with infinite resources is not good engineering (except perhaps when funded by DARPA).

As any good civil engineer knows... “Any idiot can build a bridge that stands, but it takes an engineer to build a bridge that barely stands.”

The essential characteristic of engineering is making mindful, appropriate tradeoffs between various costs and benefits, including features, risks, externalities, financial costs, etc.

Re:A day without JavaScript by throwaway47861 on Thursday June 08, 2017 @10:10AM (#14514265)
As I mentioned in another comment, it was a bit exaggerated example to illustrate a point, not to make the people nitpick it.

The corner-cutting in the current tech culture is a bit too much for my taste.

Re:A day without JavaScript by che_shirecat on Wednesday June 07, 2017 @01:05PM (#14508008)
what a ludicrous analogy. engineering is an applied science, not a purely theoretical one where you can remove the human impact of your decisions from the equation. comments like this are a prime example of why engineers need to take more liberal arts classes
Re:A day without JavaScript by dang on Thursday June 08, 2017 @01:47AM (#14512171)
I agree with you about liberal arts and have the college transcripts to prove it. Unfortunately, your HN comments have been frequently uncivil and/or unsubstantive. Would you please not post like that? It's just what we're trying to avoid here.

https://news.ycombinator.com/newsguidelines.html

https://news.ycombinator.com/newswelcome.html

Re:A day without JavaScript by throwaway47861 on Thursday June 08, 2017 @10:17AM (#14514310)
Would you be so kind to point out how would a liberal art knowledge would help people like me understanding the issues better?

I think I understand where my opponents stand, but I disagree with a part of them.

Re:A day without JavaScript by dang on Thursday June 08, 2017 @01:32PM (#14515666)
I don't know how the point applies in this case, or if it does at all. It's pretty hard to draw specific lines like that.
Re:A day without JavaScript by throwaway47861 on Thursday June 08, 2017 @10:08AM (#14514256)
It was a slightly exaggerated example. Nothing can be infinitely optimized of course, but the corner cutting in today's tech culture is a bit too much for my taste.
Re:A day without JavaScript by qwtel on Wednesday June 07, 2017 @10:25AM (#14506666)
you're right. let's get rid of safety nets, because YAGNI. it's so efficient!
Re:A day without JavaScript by dictum on Wednesday June 07, 2017 @11:05AM (#14507020)
> If you turn off JS, you get a blank screen.

I browse with JS on (but I block ads and most tracking scripts) and only use a separate browser profile with JS off for sites that look fishy.

Requiring JS for a web app or interactive features in a website is fine.

A few years ago I had to use an old PC for a while, and disabling JS by default improved my experience significantly, but too many websites simply didn't display any content without JS, or didn't load images. The "web apps vs. web pages" debate has been beaten to death, but being unable to e.g. read a blog post without enabling JS just feels wrong to me.

I'm not sure if things are as bad now.

Re:A day without JavaScript by TwiSparklePony on Wednesday June 07, 2017 @06:55PM (#14510501)
>I simply will not spend time tailoring a nascent or even mature product to 0.0001% or whatever minscule percentage of the population turns off JS.

This is reasonable logic and I think it is an important point in getting more people into a technology movement, whether it is removing JS or anything else. A similar example is getting encrytion: many users don't know or care to use it, so it is usually a side issue if mentioned at all in a company. But if the percentage of people who do use it increases, companies will have a greater interest in supporting it.

Currently, normal users just care that content loads when the click the link for a website, and perhaps don't understand or care that JS is running or what the consequences of that is. A more constructive way to get better experience without JS is to ask others to also block it to show companies that this is an issue, rather than just directly asking companies to add support.

Re:A day without JavaScript by ams6110 on Wednesday June 07, 2017 @10:55AM (#14506930)
It might make sense to think about who disables JS. Likely it's technically knowledgeable people with a concern for privacy and security. If this describes your users or customers you may benefit from at least some level of non-JS functionality.
Re:A day without JavaScript by gpderetta on Wednesday June 07, 2017 @10:58AM (#14506954)
those knowledgeable users might be installing JS blockers in their friends and family computers right now.
Re:A day without JavaScript by mathw on Wednesday June 07, 2017 @12:15PM (#14507576)
And then they get "since you played with my computer the internet doesn't work properly".
Re:A day without JavaScript by gpderetta on Wednesday June 07, 2017 @01:02PM (#14507989)
"you broke google!"
Re:A day without JavaScript by ptr_void on Wednesday June 07, 2017 @11:23AM (#14507165)
That sound fine if you don't see any problems with showing a blank page for no-js which was supposed to displays only some texts/images/links.
Re:A day without JavaScript by madshiva on Wednesday June 07, 2017 @10:55AM (#14506925)
Adobe flash is dead since many years, people that was warned that they should not do only flash website,and for the same people can browse without JS what you tell them now? they site aren't at all usefull, you failed. All website or software should never fail so easily. I truly support jaclaz. No message : you should use blablabla, or enable this, or anything else, people goes away.
Re:A day without JavaScript by Fifer82 on Wednesday June 07, 2017 @02:56PM (#14508940)
I agree, maybe kids at Google get paid big wedges for this, I don't