Hacker News new | ask | show | jobs
by StuieK 3474 days ago
So we built slant.co with the philosophy that all the reading should work ok with JS off, but the contributing systems require JS. The problem is testing, we're a tiny team so I'm not sure the last time we made sure the no js experience works as expected.
2 comments

A very easy way to ensure a website works even if not all your assumptions are met (e.g. CSS, JS, fonts are loaded properly) is called “progressive enhancement”: Build the system as good as you can without JS, then add JS on top for the things you can only do with JS. All web sites I created using that technique required minimal testing on systems without JS.

https://en.wikipedia.org/wiki/Progressive_enhancement

This is the trouble with web dev. There are a million factors in play, and it's very tough to create tests for them all, not to mention potentially financially restrictive with the need for multiple browser testing VMs. You have to test cross-browser, make sure all the versions of IE you want to support play nicely with your JavaScript and CSS. The site also needs to be responsive and handle resizing gracefully. Then how about making your site accessible, making sure all the aria tags are where they should be, and that screen readers will read, or not read, your content properly. When there is time to polish, it's often in the form of CSS transitions or animations.

Making my site fallback to no-js gracefully affects so few people, that it falls by the wayside since there's so many other higher priorities that affect a lot more people.

The parent poster is most likely using a strategy to build web sites called “graceful degradation”, where one builds “fallback” code paths for specific scenarios. The result is something that you see on web sites that have a “desktop” (all features) and a “mobile” (not all features) version.

What the parent poster wrote about testing is only true as long as one chooses “graceful degradation” as the strategy to build web sites. Using the alternative strategy “progressive enhancement” means that one does not have to test as much. The reason is that with “progressive enhancement” the more complex functionality of a web site is built on top of the simpler (think “no JS”) layers.

https://en.wikipedia.org/wiki/Graceful_degradation

https://en.wikipedia.org/wiki/Progressive_enhancement

It may seem counterintuitive, but choosing the right approach to build a web site can save a lot of testing effort – and even make sure that a site displays on browsers one did not even consider.