Re:Ask HN: If we could redesign the Internet from scratch, w...
by bitplanets on Thursday December 18, 2014 @10:09AM
(#8767517)
If you use react.js and rcss you will be able to build your whole app with just js. Well organized and modular. No html, no css (not directly, of course. You still have to fix css issues).
Re:Ask HN: If we could redesign the Internet from scratch, w...
by archagon on Thursday December 18, 2014 @10:13AM
(#8767548)
Yeah, I added a comment about that. It's true that web frameworks essentially work like this, but I still think it's massively backwards that we're building web apps by using JS to manipulate a text rendering engine and not the other way around. In my opinion, this is one of the primary reasons why web apps never feel as good as native.
To look at it another way, this means that HTML and CSS are sort of the web's "layout and appearance bytecode", and they're pretty mismatched for that purpose.
Perhaps this will involve building the layout and plumbing of a website using straight (sandboxed) code, and then filling in the content using the same old HTML (or Markdown) and CSS. If the site has no content — if it's an online tool like a file converter or an uploader, for example — you could omit the HTML/CSS part altogether. Think UIKit: build up your view controllers, your tables, your data sources, and your nibs, and then provide the content in the form of HTML/CSS like before. (Of course, you don't have to work like this if you don't want to. Just throw up a blank view and keep working in HTML/CSS/JS if you prefer.)
(Yes, you can create a blank page and populate it with JS today — and indeed, this is what frameworks like Ember do — but you'd still using divs and the like to do it. I think this is backwards. We shouldn't be using a text rendering engine to produce web apps; we should be using web apps to host text rendering views. In other words, Ember should exist on the top level, not the bottom.)
One question that will let us know if we're on the right path is, "Can we make websites that feel just as good as native apps on mobile?" Not just "good enough", but so good that nobody will even think to write native web apps ever again. Same responsiveness; same support for gestures and touches; no more misclicks and accidental navigation.
Fundamentally, the web is for content, so it'll always be vital to be able to do things like hyperlink to arbitrary pages and open multiple links in succession. But now that most of the web's content is inside these overarching web apps, and also that websites are being used for purposes other than content, it's important that the tools we use grow along with the web.