Wednesday, January 30, 2013

HTML: Can't handle the confusion? Shouldn't have become a web developer.

Looking back at the history of HTML and its emerging trends can get quite messy.

I love the idea of HTML 5 and developing some really cool web apps but all those new elements and the varying support have lead me to do a sanity check on all the HTML tags I have at my disposal. And I doubt it's going to settle down any time soon. But I guess that's same story as usual.

In HTML, there is the standard, there are the recommendations, and then there is reality. And at the end of the day, its what works that counts, regardless of whether it is offically approved or not.

Besides adding many new elements, HTML 5 has dropped a few older tags traditionally used for styling. This is a good thing but not nearly enough of the old tags have been dropped for my liking.

For example, why is <big> dropped but not <small>?

Remeber when <tt> was recommended over <code> and <samp> for mono-spaced font? Well <tt> has been dropped but <code> and <samp> are still there? I agree, the only time we see a teletype machine these days is on old movies, but I still fail to see why a browser, regardless of device type or screen resolution is going to show source code in different way to any other browser.

Remember in HTML 3.2 where <strike> was recommended over <s>, the later having been pretty well dropped. Well now <strike> is out and <s>, which came back in with HTML 4 is the winner. <s> probably achieved this by developing an alternate semantic purpose. Rather than meaning strikethrough, <s> is now supposed to mean "Somethings not right with this text". It's still strikethrough at the end of the day though.

And if <s> can change to mean "incorrect" why can't <b> take on the meaning of <strong> and <i> the meaning of <em>?
<b> and <i> are still there but are still strongly discouraged. The argument for this goes like this:

<b> as bold, is a direction of style, not meaning. <strong> on the other hand means to stand out. Some browsers may choose to make the text stand out in way different to bold. In cases where you really want bold, you should use CSS.

But in reality, every browser just bolds the content of <strong> and <strong> has taken on the meaning of bold. Just look at any HTML editor and press the [Bold] button. You will note that they almost always achieve the bold by using the <strong> tag, and not by CSS or <b>, even though in this case, the latter is more correct as per the user's intention.

Same thing for <em> and italic too.

And now of course we have <mark> as in marked with a yellow high-lighter.

My problem is that <strong>, <em> and <mark> all have the same meaning, to make the text stand out. In reality, when your deciding which to use, you end up asking yourself do I want the text bolded, italic or marked in yellow, which is a styling intent, so should be done with CSS anyway.

Any why was <acronym> dropped in favour of <abbr>? A coin flip? Less characters to type? I can't think of any other reason to favour one over the other. Do screen readers spell abbreviations out loud but attempt to read acronyms as words?

(Wow, I'm starting a lot of sentences with And here. My english teacher would turn in her grave.)

There are also a few new tags which I'm not sure I value much. <output> and <time> for example, that as far as I can tell just render as normal output. There is an expectation that they might be rendered a different way in the future. Well I have an expectation that once people get used to them rendering as normal, changing that later is probably not going to happen.

And finally, why can't we come up with one universal format for audio and video. There are three formats for each and not one of the six is supported by all the major browsers. It is a classic case where commercial interest and pride win over common sense. And because we lost this battle now, it's going to be a long time before we ever get to fight it again.

No comments:

Post a Comment