This content originally appeared on Go Make Things and was authored by Go Make Things
I’m very vocal about my dislike of HTMX, and one of the big reasons is because it very much works against the grain of the web rather than with it.
Last week, I was having a discussion about this on Mastodon, and someone asked me what “with the grain of the web” actually means. Today, I wanted to talk about that.
Let’s dig in!
The grain in woodworking
The phrase “with the grain” comes from woodworking.
The grain is the direction the lines of the wood naturally flow in. Generally speaking, you want to cut wood “with the grain” rather than against it.
Cutting with the grain makes it far more likely you’ll have nice, clean, easy cuts that look good. Cutting against it makes it far more likely you’ll end up with tears and splits and rough edges.
The grain of the web
When talking about with the grain of the web, we’re using a metaphor about craftsmanship and the natural state of the medium with which you work.
When you work with the grain of the web, you lean into how the web was designed to work out of the box, rather than fighting against it with hacks and clever workarounds.
When I say “how the web was designed to work,” I mean things like…
- Separation of concerns
- Using HTML for content, CSS for style, and JavaScript for interaction (rather than muddling them all together)
- Using hyperlinks (
<a href="...">
) for navigation to another page - Using buttons (
<button>
) for interactive content - Using forms (
<form>
) to send or request data from a server or API - Loading a new HTML file when navigating from one view to another (rather than SPAs)
- Taking advantage of the cascade to write less CSS
- Understanding HTML semantics (including it’s gaps), and building accordingly
- Progressive enhancement
- The unpredictability of the runtime (the browser)
Nearly every single problem with the modern web stems from a refusal to acknowledge or accept the nature of the web, and to subsequently work against it rather than with it.
Respect the medium
The modern web platform is incredibly powerful.
We could have fast, amazing websites and web apps. Instead, we have a slow, clunky, fragile web that breaks constantly, barely works on older devices, and implements many of the same features we had in the early 2000s with more complexity and less reliability.
The modern web can build things far more advanced than we could have imagined a few decades ago.
You might assume the complexity of modern web development is a result of that. But development complexity has grossly outpaced the complexity of the things we’re actually building.
The modern web makes it easier than ever to build complex things, and our silly monkey brains keep throwing more complexity on top of it anyways.
This content originally appeared on Go Make Things and was authored by Go Make Things
Go Make Things | Sciencx (2024-06-10T14:30:00+00:00) What is “the grain of the web?”. Retrieved from https://www.scien.cx/2024/06/10/what-is-the-grain-of-the-web/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.