by FactoryReboot · 4y ago · 0 comments
Given all the html created via a component like pseudo element, it further questions the value added imo.
Potentially unpopular opinion, but semantic HTML failed to adequately solve any problems it has set out to solve. Even selectors are better done via something like css modules anyway.
Sure the end compiled HTML is a mess, but that’s like complaining your bytecode or binary is messy. Who cares?
Long live div soup.
Everyone who downloads more data than necessary cares, or whose browser has to spend more battery power to parse that HTML, or who has to wait because you made a page that can't being rendered as it streams in, or any developer who needs to debug that mess in 2 years time because you couldn't write something simple and understandable and you've moved on to a new role.
(Not that any of those things are about semantic HTML specifically; they're more about caring about the structural output of your code.)
And come on, html parsing is the cheapest thing of all that happen there. The most of work goes into font rendering and jpeg decompression. Every paragraph adds CPU workload incomparable to any amount of divs, literally tens of thousands of calculations, if your system uses hinting, kerning, etc.
who has to wait because you made a page that can't being rendered as it streams in
This is just a personal preference. At the times of 14.4k and no-images button in the toolbar it was useful, but not today when you can download a megabyte per ping time. I like to see sites as they were intended to be seen and not jump around and change colors with every chunk of html or css. I actually hate sites like that.
No one likes layout shifting. There's no reason why a site should be jumping around just because the HTML is being rendered as it streams though. Stopping layout shift is more to do with prioritizing layout CSS (inlining important styles for example), avoiding dynamic content injection (eg server side rendering instead of lazy loading content) and providing proper hints to the browser about where things should go, how big things are, and so on.
» Facebook adds 5 divs, 9 spans and 30 css classes to every single post in the timeline to make it more difficult to identify and block 'Sponsored' posts, oh my.
Previously on hn, https://news.ycombinator.com/item?id=19115460
A true win for the opposition would be to study the literature for ad jamming techniques that would turn people against the advertised content, and alter the ads to be long term subconsciously unappealing / damaging. (eg. "McDonalds McRoach Sandwich")
Bonus points if it could unravel dark patterns, gamification, and engagement optimizations.
[EDIT] I'd to add that for the specific but now-niche use case of writing HTML by hand (which, in an editor with good tag completion and auto-formatting, I find almost as fast as, and far more powerful than, Markdown) semantic tags can be really nice.