4 ms·
Sure, but the author is advocating that you compose HTML this way. It would quickly become a mess of nested elements with zero visual indication of hierarchy.
by robgibbons 4y ago
Sure, but the author is advocating that you compose HTML this way. It would quickly become a mess of nested elements with zero visual indication of hierarchy.
The DOM is a tree, with nested elements. Losing that information doesn't get you anything but tag soup (which is, oddly, what the author suggests this style is supposed to avoid)
- nerdponx 4y agoThe problem is that HTML has multiple uses. The author is describing the case of authoring content, with HTML used as a markup language. However a lot of websites and web applications use HTML more like a layout and templating engine for a GUI framework.
- falcolas 4y agoOnly if the formatter is unaware of HTML. If it can't handle automatically closing <p> tags, then it's unaware and is trying to treat HTML like XML. Or, to put another way, HTML != DOM, even though HTML can be rendered into a DOM.
- LeonB 4y agoIn a tree you have branches off branches off branches etc. You can’t orient yourself - you can’t tell where you are - unless you count the branches. And indenting makes that visible. In the examples for TFA, you can tell your location from the names of the elements. Eg <td> is enough for you to know you’re probably inside a tr inside a table. And that is the more common case than the general tree example. But a method of describing html does have to answer the question of how it represents arbitrarily deep nesting. But I like the answers it’s given for the more common case of structures that are not arbitrarily deep.
- Jcowell 4y agoWhat’s a TFA?
- dec0dedab0de 4y agoThe Fine(or Fucking) Article
- shkkmo 4y agoI always read the 'F' as "Featured"
- nayuki 4y agoAnd this terminology (TFA) comes from at least the Slashdot days, about 20 years ago.
- anjbe 4y agoIn turn, probably descended from “RTFM”—on Slashdot people who commented despite obviously not having read the article were told to “RTFA,” which eventually led to “TFA” as a general term to refer to the original article.
- LinuxBender 4y agoUrbandictionary agrees. I reprogrammed myself to read it as "Fabulous" using a text replacement addon.
- mlok 4y agoThe "F" has always been "Forementioned" for me.
- SkeuomorphicBee 4y agoFirst and foremost, the author advocates for organising documents in a much flatter DOM tree. In this style all major page elements sit at the same hierarchical level, so there is no "mess of nested elements", the is no need for visual indication of hierarchy if there is no hierarchy to begin with. I think that is a very compelling format for a text-first web page, like a blog post or news article. Of course it is a coding style not well suited for complex web apps with deep hierarchy.
- niconii 4y agoOne interesting detail is that a lack of deep nesting was in fact a deliberate design goal for HTML originally, to make WYSIWYG editing more feasible. http://info.cern.ch/hypertext/WWW/MarkUp/HTMLConstraints.html http://info.cern.ch/hypertext/WWW/MarkUp/HTMLConstraints.htm...