4 ms·
Imagine writing code that outputs to HTML for your company. They require support for emphasizing some words, so you use the i and b tags. Your company then dec
by kstenerud 3y ago
Imagine writing code that outputs to HTML for your company. They require support for emphasizing some words, so you use the i and b tags.
Your company then decides that Japanese text should be supported. Now your code needs to output italics / underlines for English, or emphasis dots / enlarged text / font change in Japanese. You dutifully add the style sheet shenanigans and special case HTML generator code to do this.
Next, your company wants to support Hindi. So now your code needs to support three different ways to render the text depending on intent and language - with all the maintenance headache this entails.
... and so on.
Soon enough you start to think "This is crazy! I'll just make some style classes for things that need emphasizing, and then put the presentation stuff in the style sheets. That way I can greatly simplify things!"
And now you've invented em and strong.
The whole reason why style sheets were invented was to separate intent from presentation. The i and b tags in HTML are a classic example of engineering failure due to the assumption that they knew enough about a subject outside of their wheelhouse, and as a result failed to consult the experts (in this case, typesetters). Once the experts weighed in, the i and b tags were (rightly) deprecated.