Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A few weeks ago I turned off javascript in my browser out of principle and to see if progressive enhancement was still a thing web developers cared about (hint: it's not). I was pleased that HN worked fine, and the only annoying thing was that voting caused a page reload. It's nice to see this get the attention it deserves!

Developers! You probably don't need javascript to achieve 90% of your goals. It will just slow your page load speeds.



This is true, however javascript is a tool that can be useful if you are building something that provides an interactive experience for the user.

In such a scenario, I have to write code somewhere to provide the experience. If I am writing it on the server side I run into several issues.

It uses server resources. For example, let's say the user is looking at a large dataset. They want to sort/search/filter that dataset. Given that they already have the data in their client, it often makes sense to use their resources to sort/search/filter the data. This lightens the load on the server.

User actions suffer from latency talking to the server. Again, if the user already has all the data that they want, not talking to the server can often result in a better user experience. Imagine something like an incremental search. Such a thing might even be impossible to implement server side due to latency issues.

Implementing client side functionality in the server can add to software complexity. Things like keeping track of user state can be handled much more cleanly on the client side.

Very often it makes tremendous sense not to make a "web page" for something that needs a lot of user interaction. Instead you want a stand alone application that gets data (without presentation) from a server. Writing your application in javascript, running it in a browser, using HTML as a presentation layer and using HTTP as your communication protocol is not a stupid way of implementing such an application (and I say this having written these kinds of applications with a variety of different technologies).

If you are writing a web page that is intended to simply present data, then Javascript may very well be unnecessary. For me, though, this does not come anywhere close to 90% of my goals.


I don't think client side scripting is always innapropriate. I just think it often is. For example, I've seen a lot of pages that just display some copy marketing a product that won't display properly without JavaScript. On the other hand, complex sites like github work fine without JavaScript.

I totally agree, if you are thinking about maintaining user state on the server, you are probably doing it wrong, as you are violating REST. That's the nice thing about using dumb clients, is it forces you to think about application state changes using hypermedia, instead complex client side logic. I think this leads to clean APIs.


But note what you assert yourself: reloading on every click is annoying. And not reloading, but also not providing feedback that you successfully clicked the button is also annoying.

The 10% of your goals that you do not achieve without Javascript are essential to changing 'the web' from being a clunky to being a nice experience. The web without the least bit of Javascript is like a world without fire: you'll survive, but it won't be nearly as comfortable. Fire inevitably led to nuclear bombs, but we should certainly not disavow fire because of that. We should just be against the nukes.


I agree. Sometimes your soup could use some salt in it, but you shouldn't just skip the soup and go directly to eating salt.

If someone decides they don't want any salt, they should still be able eat the plain old boring soup. They'll get the nutrition they need. Maybe it won't taste quite as nice, but the primary function of the soup is still there. Plus your soup is more accessible to people on low sodium diets, and takes less time to prepare!


The next major update in all browsers absolutely must be this: inability to turn off JS. Because no one in a sane state would EVER do this now.

Why not a checkbox to turn off HTML? It would be just as "useful"...

I do need JS to achieve all my goals that can be achieved with JS. For those things that can be achieved without JS but often mistakenly involve it (hamburger menus, animations etc), I use plain markup and CSS3. But I'm not going to ruin the UX on mobiles, where in developing countries traffic still matters, just for some paranoid freaks' sake.


Also, I'm not a "paranoid freak"

I'm just curious about how the web works and how modern sites use JavaScript.

Maybe I'm talking out my ass, since UX isn't my field, but I imagine that 90% of UX is "the application allows me to do the thing I'm using it for, it has logically layed out screens, and navigating between screens is fast and intuitive." I think hypermedia accounts for these concerns. Sure there are some annoyances, like "voting on a comment or article causes the screen to flash." It's a little jarring but everything still functions. You can sprinkle some JavaScript in, like on HN, to smooth that over.


Your site will be much more usable in developing countries with low spec mobile devices and high latency, low bandwidth networks if you design it to function first without JavaScript. You will reduce page weight, and client side CPU usage.


Client-side CPU usage, as well as page weight, isn't a problem if JS is done right. Angular-like bloatware certainly ruins all the zen. But that doesn't mean you should rush to another margin and make everything server-side. Modern web technologies allow you to keep everything beautiful, smooth AND lightweight. But in order to achieve that, you'll need to learn more than a couple of bloatware libs like angular or jquery. In fact, you need to forget them and start thinking for real. And study, study and once more study MDN manuals.

Language doesn't make Web slow and bulky. People do.


Agreed! Learning the latest and greatest library isn't going to make you a better developer. I'm not saying client side scripting has no place on the web, I'm just saying for many purposes its place is overrated, and that basic functionality can be provided through hypermedia alone.


For me it doesn't bother reloading; but it shows up when I reload.


But they need it to keep their job :p


But they'd have more hours to bill if they bothered to make their web pages work with JavaScript disabled!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: