Hacker News new | ask | show | jobs
by ZeroGravitas 4498 days ago
Still the most comprehensive rebuttal to this common (and I feel, badly mistaken) complaint:

"About HTML semantics and front-end architecture" (from March 2012):

http://nicolasgallagher.com/about-html-semantics-front-end-a...

It's all well worth reading, but the conclusion is particularly to the point:

"The experience of many skilled developers, over many years, has led to a shift in how large-scale website and applications are developed. Despite this, for individuals weaned on an ideology where “semantic HTML” means using content-derived class names (and even then, only as a last resort), it usually requires you to work on a large application before you can become acutely aware of the impractical nature of that approach. You have to be prepared to disgard old ideas, look at alternatives, and even revisit ways that you may have previously dismissed.

...

When you choose to author HTML and CSS in a way that seeks to reduce the amount of time you spend writing and editing CSS, it involves accepting that you must instead spend more time changing HTML classes on elements if you want to change their styles. This turns out to be fairly practical, both for front-end and back-end developers – anyone can rearrange pre-built “lego blocks”; it turns out that no one can perform CSS-alchemy."

1 comments

That's no rebuttal, just an opinion. Oh we got this huge app and are to lazy to do everything properly.
Saying "do everything properly" is an opinion too. Why is semantic markup more "proper" than Bootstrap's <div> and class names? The idea that semantic markup is a beautiful paradise is unsubstantiated. If you want non-humans to understand your markup you can use microformats, http://schema.org/ markup, or another form of microdata. Making "semantic" class names doesn't change how your users or search engines parse your content.
I'm not convinced you read the link, rather than just the bits I quoted.

Also, laziness is one of the three great virtues of a programmer according to Larry Wall. People are getting things done with Bootstrap every day.

> People are getting things done with Bootstrap every day.

That is not an argument for correctness of approach. If there arose a cult of builders who decided to pour foundations with wheelbarrows and bags of concrete rather than a mixer, I'd tell them they're doing it wrong no matter how many houses they built this way.

The problem is that you can demonstrably point out objective flaws with using wheelbarrows and bags of concrete (or I assume you can - I know nothing about pouring foundations).

With the cult of semantic HTML, the flaws in using class names to describe presentation are almost always not explained beyond some vague notion of "correctness", and possibly an example that bears to relation to reality when you take into account that almost all HTML is being generated by some sort of templating engine anyway.

The problem with using wheelbarrows is that it will take a really really long time to get anything done.

"Semantic" css is like a cult of builders who sort the stones in their concrete by hand, and will only use the bluish stones for the foundation and the reddish stones for stairs. You point out to them that it simply doesn't matter, and they are shocked that you're not doing things the "right" way.