Semantic HTML has Other Benefits

Just got done reading Our Pointless Pursuit Of Semantic Value at Smashing Magazine today. It’s a good read, and clearly spells out a true point: There is not a lot of value in wrestling over how semantic your code is for semantic’s sake. I totally agree with this. While SEO and accessibility are often cited as reasons to pursue semantics, quite frankly, there is a lot of thought that semantics don’t help as much as people think (examples of which the author notes.)
Does that mean that semantics are worthless, and you should just use a div and a span for everything? No, and I don’t think that’s what the author is saying.
Semantics means different things to different people, but I’ve always looked at it as the process by which I identify things in the markup. This identification is important because it’s what I use to go back and manipulate things through CSS and JavaScript. In that way the process of making your HTML semantic is a lot like naming variables in more traditional programming.
So I see the new set of semantic options in HTML 5 as more choice, and I welcome it. Why? Because it makes it possible to turn this:

https://gist.github.com/1358362.js?file=gistfile1.html

into this:

https://gist.github.com/1358370.js?file=gistfile1.html

It’s not a huge differece, and doesn’t change anything about the presentation, but does make it easier to read. So it allows me to write more easily understood and maintainable markup. Now that doesn’t mean I arbitrarily use new tags. I do consider the meaning behind the tags when I use them. But not so much so that I allow myself to get paralyzed by it. Do I care that 
address doesn’t technically mean postal address? Not in the least. Do I care that dl might not be blessed to be used exactly the way I am using it. Nope.

It comes down to this, using Semantic HTML in the hopes of communicating to browsers and accessibility tools might have some diminishing returns. However using Semantic HTML to communicate to other developers can still yield a lot of value.

2 thoughts on “Semantic HTML has Other Benefits

  1. I also find writing semantic html is beneficial to my own clarity of thinking, especially when it comes to designing the markup for JavaScript widgets, etc.

    I’ve seen, far too often, html elements being programmed as links in javascript when they could have been tags in the first place. Using anchor tags is semantic, using js to turn an img tag into a link is not and leads to so much unnecessary code.

    By designing simple and semantic html, writing js that plays with that markup becomes easier.

    Like

Leave a comment