4 ms·
This is a fairly common, and I believe correct, use of the word "tag". The MSDN reference uses the term in a similar manner (as do countless other definitive re
by pard68 3y ago
This is a fairly common, and I believe correct, use of the word "tag". The MSDN reference uses the term in a similar manner (as do countless other definitive resources and tools). Consider the first sentence of the MSDN's page on HTML elements:
> This page lists all the HTML elements, which are created using tags.
-- https://developer.mozilla.org/en-US/docs/Web/HTML/Element https://developer.mozilla.org/en-US/docs/Web/HTML/Element
The "tag" is the word between the "<" ">".
- layer8 3y agoYour quote doesn’t support your argument. Yes, elements are created out of tags (plus content). But a single tag generally does not constitute an element, except for self-closing tags like <br>. I agree that it’s a somewhat common mistake to refer to HTML elements as “tags”, but it’s unfortunate to bake that mistake into a language.
- lolinder 3y agoIf it's common enough it's no longer a mistake, it's just how the English language is. If everyone understands each other, then insisting on a "more correct" usage is just pedantry. Can you provide a concrete example of a case where this usage would be confusing?
- gremlinunderway 3y agoYou can't really have a "mistake" unless there's an authoritative source and standard that everyone agrees to use. Language evolves with use, and being really passionate about an idealized standard in your head doesn't somewhat materialize it as the "correct" way.
- xigoi 3y agoThere is an authoritative source – the HTML specification.
- lolinder 3y agoThe HTML5 spec does not take a stance on how the words "tag" and "element" should be used in day-to-day speech or in other projects, it just distinguishes them for the purpose of the spec. A specification has to be very precise in its wording, but that doesn't mean we all do all the time.
- eyelidlessness 3y agoI think it’s better framed as an imprecision than a mistake. The naming language has evolved in common real world usage, in the “can’t put the toothpaste back in the tube” sense of language evolution. As such, it isn’t (any longer) incorrect, only imprecise. It isn’t even necessarily ambiguous, because the usage context tends to disambiguate it. There are certainly cases where the precision matters, but I think this is only one such case if the imprecision causes misunderstanding by users of the Imba language.
- sheepscreek 3y agoThings are often messy IRL - especially when they happen organically such as the meaning of words (try defining what is a sea and a lake with no exceptions). I remember ‘tag’ was used colloquially in the ‘90s - this was before Javascript was popular. When DOM became a thing in 1998, the definition was more formalized to be consistent across JS and HTML. As things stand, tags usually come in pairs, except for a few (such as <br/>?). An element is now defined as both tags + the content. I believe this evolution happened organically, and many people still prefer the use of ‘tag’ to mean an ‘element’ for conciseness. Update: edited for clarity
- runlevel1 3y agoWords naturally become overloaded. It helps lower the barrier to understanding a new concept because you have an existing concept to leap from and language to use. It comes at the cost of precision. The words `node`, `class`, and `tag` in particular are used all over the place. There's a reason for the joke that the two hardest things in software are cache invalidation and naming things.