Live data from Hacker News

Write HTML Like It's 1999

bradleytaunt.com

31–40 of 191 posts

Re: Write HTML Like It's 1999

#31
post #18

I've never understood the purpose of "semantic" html. It seems to be bandied about as some sort of unquestioned good, but why? If the code is easy to understand who cares that the "correct" tags have been used? Obviously there are some benefits for screen readers and search engines, but these uses should be explicitly checked for as part of a QA process instead of relying on some vague standard of semanticness.

Honestly, there isn't, except for a small subset related to screen readers.

At one point there was a kind of hope that semantic tags would make web content easily machine-parseable, unlocking a bunch of meaningful content reuse somehow that better semantics would make possible. (Big data, ML and all that.)

The two canonical examples being that lists were important so software could extract meaning from list items, and not using tables for layout so software could trust tables actually had meaningfully tabular data.

But... that never really happened, it's not clear it ever will, and it doesn't benefit the content author directly anyways, so... yeah.

(Like you say, screen readers are the main thing, so use the tags and attributes that are important to screen readers, like buttons and alt text... but that's a very specific subset. A screen reader certainly doesn't care if you use a or an or a .)

Edit: I stand corrected on my example, for specifically I forgot lets screen readers navigate vertically and also read column/row labels.

Re: Write HTML Like It's 1999

#33

Don't get me wrong, I used to write as semantic HTML as I could; nav for navigations, table for table's, aside for well asides, etc as the author suggests, but ultimately it just really doesn't matter. nav and div render exactly the same. In fact, I find zero value in using ul/li's for lists that aren't bulleted. I know it's an unordered list of items, but really, what _is_ the value in writing semantic HTML if the d…

I thought this as well until a recent project needed to meet WCAG or whatever the requirements are called for accessibility... in those cases using the "standard" tags can save a lot of headaches in trying to make sure a screen reader knows what's going on with the page...

Re: Write HTML Like It's 1999

#34

Don't get me wrong, I used to write as semantic HTML as I could; nav for navigations, table for table's, aside for well asides, etc as the author suggests, but ultimately it just really doesn't matter. nav and div render exactly the same. In fact, I find zero value in using ul/li's for lists that aren't bulleted. I know it's an unordered list of items, but really, what _is_ the value in writing semantic HTML if the d…

Accessibility is one reason. A web page may Visually look the same regardless of which elements you use, but it may be treated very differently to screen readers used by visually impaired people.

Using semantic HTML also helps search engine crawlers and other automated software understand the structure of your pages.

Re: Write HTML Like It's 1999

#35
post #18

I've never understood the purpose of "semantic" html. It seems to be bandied about as some sort of unquestioned good, but why? If the code is easy to understand who cares that the "correct" tags have been used? Obviously there are some benefits for screen readers and search engines, but these uses should be explicitly checked for as part of a QA process instead of relying on some vague standard of semanticness.

As with most things like this in tech (and every other economic sector that has ever existed) it's largely a guild protection and enforcement matter. When economic guilds use an unnecessarily strict 'only proper way of doing a thing,' it is for insulation against outsiders and to enforce their control over the domain they have a personal stake in. To the extent that it's truly petty, that is the extent to which the person shouting about it has very little protection from eg an endless flood of low priced competition (Web developers have historically been very exposed); or otherwise it's just pedantry run wild and a personal issue.

You see this in all professions and without exception, from the exercise industry, to trades like plumbing, to healthcare and everything inbetween. Most of it is bullshit, process-based job security theater. Most major guilds just end up developing higher level cartel-like certification protections to keep them economically secured from competition.

Re: Write HTML Like It's 1999

#36

Don't get me wrong, I used to write as semantic HTML as I could; nav for navigations, table for table's, aside for well asides, etc as the author suggests, but ultimately it just really doesn't matter. nav and div render exactly the same. In fact, I find zero value in using ul/li's for lists that aren't bulleted. I know it's an unordered list of items, but really, what _is_ the value in writing semantic HTML if the d…

I thought this as well until a recent project needed to meet WCAG or whatever the requirements are called for accessibility... in those cases using the "standard" tags can save a lot of headaches in trying to make sure a screen reader knows what's going on with the page...

just stay away from the public sector and let underpaid people "good with computers" do the accessibility stuff

Re: Write HTML Like It's 1999

#37

It is embarrassing, but I only know how to write HTML like it’s 1999. The last new thing I learned was an iframe, the kids tell me CSS something I should learn...

iframes have had a wild ride in acceptance

1999 - Cool and Clever

2005 - Horrible

2010 - Horrible but sometimes necessary

2015 - Awesome

Re: Write HTML Like It's 1999

#38
post #4

I feel like there's strong friction between HTML trying to semantically describe the structure of a page page and JS frameworks where you try to build custom reusable components which might not fall into the rigid structure defined by classic HTML.

The spec authors would have done better to make the semantic stuff attributes. It's difficult to tell what CSS rules you're going to have to apply to any given semantic tag, which makes people instinctively reach for s and s. React native gets this right, with and and just a handful of others, with attributes like testID and accessibilityLabel driving automated software that needs to read the screen.

Re: Write HTML Like It's 1999

#39

Don't get me wrong, I used to write as semantic HTML as I could; nav for navigations, table for table's, aside for well asides, etc as the author suggests, but ultimately it just really doesn't matter. nav and div render exactly the same. In fact, I find zero value in using ul/li's for lists that aren't bulleted. I know it's an unordered list of items, but really, what _is_ the value in writing semantic HTML if the d…

> I find zero value in using ul/li's for lists that aren't bulleted

Browsers don't care. You may not care either. But people with disabilities attempting to make sense of your website do, very much so.

There's absolutely no reason __not__ to use semantic HTML, and many reasons to do so.

Re: Write HTML Like It's 1999

#40
post #34

Don't get me wrong, I used to write as semantic HTML as I could; nav for navigations, table for table's, aside for well asides, etc as the author suggests, but ultimately it just really doesn't matter. nav and div render exactly the same. In fact, I find zero value in using ul/li's for lists that aren't bulleted. I know it's an unordered list of items, but really, what _is_ the value in writing semantic HTML if the d…

Accessibility is one reason. A web page may Visually look the same regardless of which elements you use, but it may be treated very differently to screen readers used by visually impaired people. Using semantic HTML also helps search engine crawlers and other automated software understand the structure of your pages.

I understand writing semantic HTML helps with accessibility, but it is by no means a silver bullet.
Post reply on HN