Hacker News new | ask | show | jobs
by Silhouette 3408 days ago
Do you realise that every item on your list wasn't just possible but flourished without JavaScript

No, I don't realise that at all.

Imagine how tedious it would be even to use a relatively simple discussion forum like HN if you had to wait for a full page reload every time you hit a voting button or expanded/contracted a thread.

That's about as simple an interaction as you can get, but there are countless other simple examples where JS-based interaction is much more responsive and easier to use than a round-trip to the server. Think real-time form validation, for example.

At the more complicated end of the spectrum, how exactly would you implement a web app like, say, a spreadsheet, without any client-side interaction?

JavaScript is ... swallowing up what was a thriving hypertext infrastructure.

Sure it was, 20 years ago, but the technology has evolved to serve new purposes, as technologies do. The Web of 2017 is unquestionably far more useful for far more people than the Web of 1997, and the interactivity offered by JS is a significant contributory factor.

2 comments

> Imagine how tedious it would be even to use a relatively simple discussion forum like HN if you had to wait for a full page reload every time you hit a voting button or expanded/contracted a thread.

You don't need a full page reload to implement voting; that's what the 204 No Content response is for: your browser sends the vote & doesn't refresh the page.

That's a fair answer in the specific case of voting, but it doesn't help in the other situations I mentioned.
> Imagine how tedious it would be even to use a relatively simple discussion forum like HN if you had to wait for a full page reload every time you hit a voting button or expanded/contracted a thread.

If javascript did not exist HTML/CSS/SVG would have evolved simple features like submitting a POST when an element is clicked without reloading a page.

Iframes were already enabling something similar and CSS supports animations.

If javascript did not exist HTML/CSS/SVG would have evolved...

Perhaps it would. Perhaps if JavaScript did not exist then we would have developed better tools for building what we now call web apps instead. Perhaps if JavaScript did not exist, those apps would be using something separate to the Web, and the Web would have remained a mostly non-interactive, read-only medium. I'm quite sure that with the wisdom of hindsight that we enjoy today we could have designed much, much better ways to do what web apps are doing.

But the thing is, JavaScript does exist, and it's being used to provide sites/apps that many people find useful, arguably much more useful by now than the original purpose of the Web. Meanwhile, those hypothetical alternatives do not exist, and so obviously they aren't providing any of that desirable functionality to users.

This being the case, I think reverting to the Web being a very limited medium that doesn't offer those benefits is no longer plausible. It would set the development of useful and/or enjoyable technologies used by billions of people back 10-15 years, and there's no guarantee that whatever would actually evolve to replace it would be any better.

I'm been developing for the Web professionally for many years, and a programmer for many years more. I'd be the first to agree that what we have today has problems, some of them serious, and that we should try to do something about them. But no-one's going to stop the train or turn back time, so any realistic solutions have to start from where we actually are and provide better practical alternatives, not start from where some of us might have preferred to be and provide wishful thinking.

Perhaps if JavaScript did not exist, those apps would be using something separate to the Web, and the Web would have remained a mostly non-interactive, read-only medium.

You're overestimating the importance of JavaScript here. phpBB didn't start using JavaScript until phpBB2 was released, and I believe that UBB, the forum software phpBB was based on, didn't use JavaScript either at the time. (Of course, this was partially because JavaScript was so limited back then.)

OK, but forum software on the level you're talking about was near the pinnacle of social networking sites at the time, and seems almost prehistoric by modern standards. The kind of slick interfaces and near real-time feedback that users enjoy and expect on today's forums can't be done the same way, so instead JS is widely used both for simple things like collapsible discussion threads and for more sophisticated interactions like live previews when typing comments with formatting.

A case in point: I'm typing this on HN, which is a forum I read often and enjoy for its content and for the interactions with fellow contributors. However, the interface to HN is unquestionably less efficient than the interface to Reddit, which offers similar functionality but without limitations like needing to open a new page that only shows the immediate parent comment when replying to something.