4 ms·
> JavaScript always was a bad idea, for the simple fact that automatically executing untrusted code from untrusted and unknown sources is a bad idea. The premi
by wvenable 9y ago
> JavaScript always was a bad idea, for the simple fact that automatically executing untrusted code from untrusted and unknown sources is a bad idea.
The premise here is completely wrong. A modern web browser is a sandboxed application delivery platform. The entire purpose is to execute untrusted code and it does so remarkably well. Take this away and you just have a document viewer -- a sophisticated one for sure -- but one always limited to its original purpose.
This proposed solution would eliminate many of the applications that web users use every single day and many more that haven't even been invented yet. HTML5 games would be impossible. Forget Google Maps. It's not even worth entertaining.
> In the company of the two declarative languages HTML and CSS, the imperative, all-purpose JavaScript always seemed the odd one out.
Declarative languages are extremely limiting and the trend has been to move away from them. For example, the introduction of Service Workers to replace manifest files.
Much of the success of the web has been in defiance of the declarative nature of the formats rather than in support of them. We're building complex applications in a declarative format designed for documents and that's only possible because we can imperatively manipulate those documents with code.
- marssaxman 9y agoThat all sounds like a pretty good idea to me. I was happy with the distributed document viewer system and never actually wanted the complex application platform. I still don't want it, but I'm forced to put up with it if I want access to the document viewer system, because the two wildly different projects have been smashed awkwardly together. Since the web as a document viewer system appears to be dying, leaving only the distributed application system I don't really want to use anyway, perhaps in a few more years I'll be able to abandon the web thing and do something else.
- krapp 9y ago>Since the web as a document viewer system appears to be dying, leaving only the distributed application system I don't really want to use anyway, perhaps in a few more years I'll be able to abandon the web thing and do something else. How many real "distributed applications" do you see on the web, though, versus documents with dynamic content? Is Medium, which is primarily intended to serve text, but which depends on javascript, an app or a document? What about Facebook, which despite its complexity still looks and acts more or less like a document, albeit with interactivity and asynchronous loading. Is it a matter of static versus dynamic content? Memory usage and computation? Features like AJAX and session storage? If documents are only static, non-scripted HTML pages, then do they become applications if there is server-side logic involved? I don't think there is an objective description of "web app" versus "document", I don't think the web is as cleanly cut along those lines and many might like to believe.
- marssaxman 9y agoThere's a simple heuristic that works pretty well for me: does it still make sense in Reader View? If so, it's a document, and it shouldn't have needed Javascript. If not, then it's probably a web app. I am less concerned about server-side logic than the expectation that I'm just going to be happy to run arbitrary code provided by other people on my machine.
- wvenable 9y agoDoesn't the mere existence of reader view make your point moot? The web browser is your software -- I have mine customized with plenty of plugins, blockers, and reader view. You can take content, remix it, and display it however you like. I can render this site as green text on a black background if I wanted to. I can write my own web browser if none of the existing ones do what I want.
- bassman9000 9y agoThis proposed solution would eliminate many of the applications that web users use every single day and many more that haven't even been invented yet. No big deal. When Apple introduced the App store, a maybe-not-new-but-finally-practical way of shipping applications to end-user devices was born. And they weren't webapps. No JS at first, mostly Objective-C and plists. And was still revolutionary in its reach, and consequences. Then Android came. Still no JS, but XML and Java. So, no, you don't need HTML+JS to deliver rich content application to users.
- wvenable 9y agoYou need HTML+JS if you want to deliver one single application to iOS, Android, MacOS, Android, Linux, BSD, Solaris, Chrome OS, Tizen, and OSes that don't even exist yet and not be held to a single proprietary platform owned and managed by a single entity. You could argue that it's not necessary but that's what it is. The site you're posting to now probably wouldn't even exist if it required installing a different proprietary application for every platform.
- bassman9000 9y agoYou could argue that it's not necessary but that's what it is. Yeah, that's the whole point I'm trying to make. That it's not necessary. That JS it no more special than any other language, and that there are recent, real, practical examples of absolute disruption (Apple/Android app stores) which broke what we thought it was required to deliver content to users. As per the one single application, that's a gross oversimplification.
- wvenable 9y agoNobody said JS is special but the point of the article is that code execution (of any kind) is unnecessary. The ironic part is that app store you're arguing for wouldn't even exist without the web. The web is what made Mac OS X viable for users to switch to it (and MS Office). The platform network affects that made Windows a monopoly have been drastically cut down by the web. > As per the one single application, that's a gross oversimplification. Says another person posting on a web application that runs on every platform out there.
- leadingthenet 9y agoEverything you listed as a con is exactly what I’d like the web to be.
- wvenable 9y agoSays the person posting to a web application. Where exactly do you want to draw the line?
- localcdn 9y agoHacker News has no need for JavaScript
- wvenable 9y agoJavaScript makes the upvote/downvote buttons work in a way that users expect them to work. Given that is almost 50% of the end-user functionality of this site, I'd say that's pretty important.
- deleted 9y ago[deleted]
- leadingthenet 9y agoThis website is the perfect example that a web app can be extremely functional without requiring Javascript, especially not for doing CSS and markup.