Pardon my French, but HTML
is a bastardized language. Kind of like English, HTML is a linguistic hodgepodge. HTML is a yes man: it seems to absorb all the roles and needs imposed on it, without a second’s hesitation to ask “Was I made for this? Am I even good at this?”
To be more specific, HTML is:
- part behavioral description: an input with its type attribute set to "radio" creates an input that has behavior different from an input with type=”text”
- part media description: img tags explicitly specify the media they contain
- part visual description / uncreative stylist (why are h1 and h2 tags different sizes, couldn’t you have just let CSS decide?),
- part organizational structure: use tags to enclose different elements and nest them within each other to form a hierarchical tree structure,
- part tagset/knowledge structuring markup language: use this h1 tag so that every browser/technology understands this is a heading and displays it in a helpful way regardless of viewport and in alignment with assistive technologies,
- part fundamental web technology that changed our relationship to information: anchor tags are the real world manifestation of the concept of hyperlinks, i.e., non-linear text! In other words, access to virtually infinite information: for research purposes, web scraping, doom-scrolling, YouTube-rabit-hole-falling-down, Jesus-Game-Playing, you name it. While we take the activity of "web-browsing" for granted now, this was one of the fundamental game-changers that reshaped the world, and the ability to hyperlink using HTML was what made it a reality.
As you can imagine with something given so many different roles, it doesn’t do all of them that well. However, it seems that HTML does enough of them well enough that it’s still around.
However, with all these different bizarre hats HTML wears, understanding how one SHOULD use HTML, rather than how one COULD use it can be difficult. So here are some pros and cons of HTML that I learned from the world wide web.
While venting is fun, this is not intended as a complaint about HTML (very convincing, Theo, I'm sure they all believe you now). Instead, this is for the sake of categorizing an exotic but dangerous and wily animal. I hope it helps other people like myself struggling to tame this beast:
CONS: Chaos and Complexity
HTML isn’t semantic enough: it doesn’t unambiguously tell you that this div with an h3 tag and nested paragraph tags are all talking about a single lawnmower for sale. Sure, the h3 might enclose the text “lawnmower” and the p tags might say “for sale,” “baby lawnmower,” and “never used”. However, to my knowledge, HTML doesn’t really help you explicitly tie these pieces of data together, to make it clear to a computer that these are interconnected data.
–– Wikipedia: Semantic Web
–– semantic here is used in the context of the goal of building a “Semantic Web,” i.e., a data web in which all information is appropriately structured and tagged so that it is machine readableHTML has a dumb amount of tags that most people don’t need to know: HTML specs are not really for web developer use and more for people who professionally study browsers. I get the sense that studying these specs to learn web development roughly equates to reading the dictionary to learn English. Sounds like something I would do.
–– What's HTML and how does it work? | Web Demystified, Episode 1HTML attributes also have their own problems: “Some attribute types function differently when used to modify different element types. For example, the attribute name is used by several element types, but has slightly different functions in each.” –– Wikipedia: HTML Attribute
As I pointed out earlier, HTML has at times taken on roles that make more sense for CSS. For instance, HTML presentational attributes have been deprecated in the HTML5 specs, with the advice being to use CSS to achieve the same effect while maintaining separation of concerns. These obsolete attributes can still be used, of course, which creates a lot of confusion around best practices. –– W3C: 4 Conformance: requirements and recommendations –– WHATWG: Presentational elements and attributes
PROS: Aspects of HTML that make sense to me at least
- HTML uses boxes to construct web pages. HTML is the structure and content of a web page. –– What the Hell, is HTML? :: HTML Tutorials :: EP 1 That seems simple enough, right?
- HTML accepts everything, which is what allows something to become a lingua franca. Like bread, HTML is more often the vehicle other flavors ride on rather than the target flavor itself. While HTML grew out of SGML–which was initially display-agnostic and used simply to tag information–HTML’s structure works and has continually evolved to allow it to contain many types of information.
- HTML can be modified by specifying attributes, CSS, etc.
- Scripting languages like JavaScript can be embedded inside HTML, which enables more complicated behaviors and interactions between web pages and people.
- Perhaps it is HTML’s weakness, its abject failure to clearly define its own mission, that makes it so versatile, a bridge between the user and the developer, between pure presentational display and hard data.
Maybe, at the end of the day, HTML is like humankind, as Tesla put it:
“Our virtues and our failings are inseparable, like force and matter. When they separate, man is no more.”
HTML is what it is because it has always been a hastily evolving technology. It will never be perfect. Ironically, it being so unwieldy might also make HTML easier to update as technology evolves: it’s not like it can get much worse, can it? Nobody quote me on that.
Top comments (3)
If you refer the “fork” term to a “repository forking”, people who learn HTML for the first time from this post probably wouldn’t get it 😬
Hey Taufik, I feel that, though I don't think it'll detract from people understanding the rest of the piece.
Tbh I saw Maggie Appleton using the expression "what the fork" and liked it so I used it too.
Hey Jordan, I'm still learning about HTML and I appreciate the feedback! Looking forward to reading your article on Custom HTML Tags