Hacker News new | past | comments | ask | show | jobs | submit login

> Pages are just documents and should not contain any code. Apps are fine to contain code. The problem is that we now have pages that believe they are code and apps that have to be styled using the mechanisms for pages.

Javascript was intended to script HTML pages long before the concept of a "web app" was a thing. A divide between static documents and "apps" never even existed in theory, and with very few bleeding-edge exceptions, apps are also documents.




The reason the distinction isn't present in the web standards is that the web never intended for apps to be in scope at all. Being able to make something like Google Maps available on the web is pretty much a hack.


Intent for the ability to run code on the web goes back at least as far as discussions around HTML3, and you can find discussion about it on mailing lists from 1995[0]. Before javascript took over, the intent behind the <SCRIPT> tag was to support multiple scripting languages[1], and of course <APPLET> isn't exactly new. It isn't true that the web was "never intended for apps to be in scope at all," rather it is true that HTML didn't support anything of the sort from its initial version. Of course, HTML initially didn't support much of anything.

The reason the distinction isn't present in web standards is that likely no one foresaw the massive complexity of modern js applications using HTML as a GUI analogue - it was assumed that code on the web would be like shell scripts or utility scripts, and javascript was just intended for light housekeeping, nothing that would necessitate forking the entire web to create an "app" space.

However I have yet to find much evidence of hostility towards the concept of running code on the web from the people who actually came up with it - the "javascript delenda est[2]" attitude seems to be a modern ideology. Rather, the discussions I've read were about how to make it possible, what languages to use, etc. Not how to prevent it.

[0]https://lists.w3.org/Archives/Public/www-talk/OverviewOld.ht...

[1]https://eager.io/blog/a-brief-history-of-weird-scripting-lan...

[2]https://news.ycombinator.com/item?id=11447851


Javascript was made to 'fix' faults in html forms processing such as input validation, and to allow underwater resource loading.


Among other things including DOM scripting, yes... but there was never any historical intent to consider HTML pages which used javascript at all as being something fundamentally separate to pages which didn't, or something other than documents.


I know that. But if they had made that distinction the web would be a lot safer, privacy friendly and more user friendly.


But the distinction wouldn't have even made sense at the time, and for most of the web, it still doesn't make sense. It may only make sense in the future, when WASM matures more, though.

All of the privacy violations and dark patterns that javascript gets employed for are the result of choices made by developers and corporations... they're not fundamental and innate features of javascript or of having scripting in the web to begin with, so they're not problems that would be solved by quarantining the language to some kind of "app" space.


Would it, though?

It's not like all of the problems on the web are caused by technology. Adding a <script> tag to your HTML doesn't automatically make your page weigh 10MB and snoop on its users. All those problems are caused by business decisions. When you decide to add an analytics script, or put an ad on the page, or hire a designer to make it look appealing to customers - that's where things go wrong.

In other words: even if we had a page/app split on the web from the beginning, businesses would still fuck it all up, and we'd have the same problems with bloat, ads, dark patterns and surveillance capitalism as we have today.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: