4 ms·
What, pray tell, is the semantic difference between "strong" and "emphasis"? They're lawyer words that mean anything you want them to! The semantics of HTML a
by Daniel_Newby 16y ago
What, pray tell, is the semantic difference between "strong" and "emphasis"? They're lawyer words that mean anything you want them to!
The semantics of HTML are whatever the user agent does with them. It is a declarative programming language. If HTML were a semantic tool, I would be able to define what the <strident> element means in my system spec. Instead I have to find an inline element and hijack it, which is about as semantic as a poke in the eye with a sharp stick. The necessity of using templating engines for HTML is proof that it is a pretty weak tool for semantics.
And if somebody wants to inflict S expressions on me, I'd better get macros.
EDITED.
- mcav 16y ago<strong> is intended to convey importance, whereas <em> is intended to convey grammatical emphasis (as you would emphasize a word in a sentence when speaking): "You're going to be gone for <em>three</em> weeks?" vs. "You're going to be <em>gone</em> for three weeks?" "Now we will talk about <strong>encapsulation</strong>". These definitions taken from the HTML5 spec. Obviously, the words "strong" and "emphasis" are colloquially used interchangeably, but in HTML the language, they mean two distinct things. Similarly, the old <b> and <i> have been redefined for different use where phrases should be typographically distinguished without the implication of emphasis. Had we invented HTML today, we probably would have named these tags differently, but that's the nature of backwards compatibility and gradual evolution.
- Daniel_Newby 16y agoThanks! I'm still not a fan of trying to tell machines about the meaning of natural language elements. Doing useful things with the information is equivalent to natural language processing, which is a hard problem. I once found a completely marked-up English dictionary and thought Oh, this will make it easy for the computer to understand English. Ha ha ha no. What the mark-up nerds call semantics turns out to be a microscopic subset of the full semantics. What is useful is marking up the structure of documents. Knowing what the title is and where the sections are turns out to be useful for search scoping, even if the machine has no idea what the title means.