5 ms·
> Furthermore, you're recreating functions of the browser almost immediately. There is no need to do that. The user is already running a program that can do eve
by curryst 5y ago
> Furthermore, you're recreating functions of the browser almost immediately. There is no need to do that. The user is already running a program that can do everything your code does faster. All you have to do is put the content in the right format and it's all handled for you.
There is a good reason to do that. HTML has no templating abilities built-in, which has a lot of downstream effects. Most sites benefit from a templating system, because most of their pages are very similar. I.e. each blog post has the same nav bar, each item in an ecommerce store has the same format.
You can pre-render those pages, but that becomes more and more difficult the more pages you have. Incremental builds exist, but tend to get buggy. As soon as you have a site that becomes too large to rebuild for each change you get, things become problematic.
Javascript fixes this because it allows you to treat your content like a template that accepts data. Updates are near-instant because it's often just modifying a database row.
I'm certainly not saying the current environment is perfect, but HTML-as-documents is fading because it's a restricted subset of the things you can do with HTML + Javascript. It's the same reason I don't see a lot of people logging directly into the terminal in Linux. Sure, it can do a lot of what I want it to do, but I can get a terminal in the GUI even if it's slow. The GUI can also do a lot of things the terminal can't, so I log into the GUI by default.
- mckinley_ 5y agoI think you're dismissing static site generators too quickly. An efficient static site generator will work very well for a lot of websites, because most of them aren't made up of >1,000 pages. Static sites are better for those who don't want to enable JavaScript or who would like to save a copy of the page to read later. I'm sure there are accessibility benefits with less complicated websites, too. Maybe I'm just strange, though. I log in directly to a TTY.