HACKER Q&A
📣 jzombie

Does anyone write HTML anymore?


I jest about this, but it's interesting to observe that many personal websites nowadays heavily rely on JavaScript to render even the most basic text content. In fact, some of these sites become entirely non-functional if JavaScript is disabled.

Let me clarify, I've been using JavaScript since a time when people would tease me for not coding in Flash, as it was considered the future language of web development.

I was creating SPAs (single page applications) long before I even knew what the acronym SPA stood for. I've been crafting React frontends for at least six years now (and "vanilla" for at least 10 years prior to that), so you could say I've had my fair share of JavaScript coding experience.

I understand that tools like Next.js and Remix allow you to generate server-side React that ultimately produces plain HTML output. However, what if I don't want a backend at all and still desire straightforward HTML output? (And yes, I know about static site generators; I'm even building one of my own.)

My main concern is that while search engines can certainly parse JavaScript, I suspect that they still perform best with HTML. Many websites may be missing out on better search engine results because they aren't optimized for discoverability through traditional HTML content.


  👤 legitster Accepted Answer ✓
I still do a lot of hand-coded and static HTML. I'm old-school and have a lot of muscle memory, so 9/10 it's just faster for me to throw together a page of HTML for a custom project and throw it in a directory than to muck about with a CMS or anything server-side.

> My main concern is that while search engines can certainly parse JavaScript, I suspect that they still perform best with HTML.

This isn't really true anymore, and the evidence for this is that Google themselves uses user-facing JS for lots of applications. Regardless, you can still assess the SEO friendliness of any page with the available tools.

That said, there is a good case that you should reduce the complexity of your page whenever possible. If you can get away without a bunch of JS calls, you are introducing fewer things that can introduce mistakes or performance problems.


👤 spansoa
JS is an embellishment. Think of an electric stairs, it still works even with no power. I do all my sites like this. It must work without JS, because some users disable JS for privacy or accessibility reasons, and I care about those users.

👤 adamredwoods
>> I understand that tools like Next.js and Remix allow you to generate server-side React that ultimately produces plain HTML output. However, what if I don't want a backend at all and still desire straightforward HTML output?

Then write HTML? I don't understand what you are insinuating at all. Is this a hard stance? The web is flexible enough these days to allow javascript or for you to write HTML if you want to, which you seem to desire.


👤 devonnull
There definitely are more than a few people who hand code the HTML for their sites. Often, it's people who need something simple -- no scripting, no database back end, none of that stuff. Just HTML and maybe some simple CSS.

I know a couple of people who build their (infrequently updated) sites using Markdown, pandoc, a custom HTML template, and a simple shell script.


👤 DamonHD
Yes, I write plain HTML, and have done since 199-, with JS sprinkles in sometimes. Most of the pages of my current main site have no JS at all.

Almost all (there are some legit exceptions, but not many, IMHO) pages should be functional (even if maybe less pretty) with JS turned off.


👤 vlod
If you want 'some' interactivity (i.e. minimal js), it might be worth taking a look at htmx.

i.e. Page is mostly static, but if click 'add' etc, generate html from the server and insert it into the dom using attributes.


👤 MilnerRoute
It's interesting think about people who, when they need a web site, turn to Wordpress.

There's HTML, which they're not really writing themselves. But there's also a lot of PHP.