3 ms·
Confusingly, they seem to be using the term “tag” for what is really an HTML element or component. (E.g. “<div>…</div>” in HTML is not a tag, it’s an element d
by layer8 3y ago
Confusingly, they seem to be using the term “tag” for what is really an HTML element or component.
(E.g. “<div>…</div>” in HTML is not a tag, it’s an element delimited by one starting and one ending tag.)
- pard68 3y agoThis 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.
- lolinder 3y agoGiven that there is no end tag in Imba, that's not especially confusing—there's a one-to-one relationship between tags and elements. Also, colloquially it's very common to use "tag" because to refer to both, because "element" is longer, including in pretty formal places like Shopify's API: https://shopify.dev/docs/api/admin-rest/2023-07/resources/scripttag https://shopify.dev/docs/api/admin-rest/2023-07/resources/sc...
- layer8 3y ago> there's a one-to-one relationship between tags and elements. There’s not a one-to-one relationship between HTML tags and elements, so if there is a one-to-one relationship between Imba tags and HTML elements, it follows that there is not a one-to-one relationship between Imba tags and HTML tags — that’s what’s confusing.
- deleted 3y ago[deleted]
- lolinder 3y agoBy your own insistence a tag is simply a syntax construct, so I'm not sure why it matters that there's a one-to-one relationship between Imba tags and HTML tags. All that matters is that there's an obvious mapping from one to the other (and preferably back), which there is. Also, I want to re-emphasize that most people use the words "tag" and "element" interchangeably when talking about written HTML. That may be a pet peeve of yours, but it's common enough that it's not an incorrect usage.
- eddythompson80 3y agoYeah, I always called it tag because vim calls them tags.
- Yahivin 3y agoIt seems to make sense with the example. The `tag` keyword defines a tag that is used the same as HTML tags to create an element. tag Box css pos:relative x = 0 y = 0 <self[x:{x}px y:{y}px] @touch.moved.sync(self)> <slot> "box" tag app <self[inset:0 d:hflex ja:center]> <Box[hue:blue]> 'One'