Hacker News new | ask | show | jobs
by thinkloop 2411 days ago
> wouldn't you say that when naming things for the purpose of targeting them with styling, what they look like is indeed what they are?

What do you mean? A "comment" is likely to stay a "comment" forever, whereas its bold'ness or italic'ness can/will likely change relatively often.

1 comments

Well, yes. So, in the hypothetical situation where classes are added just for styling, is it a given that the correct way to name it is a way that stays the same when the styling changes?
> in the hypothetical situation where classes are added just for styling

OK, a style-based class naming system

> is it a given that the correct way to name it is a way that stays the same when the styling changes

Not with a style-based naming system, in that case it's ok for the class name to change, and you can expect it to change often, which a lot of people argue is ok.

But like @welly said, herein lies the problem, or preference. The argument is exactly about whether you should name things in unchanging "decoupled" ways, or whether that doesn't work out in practice and it's simpler to just have utility styles.

And therein lies the problem. You don't add classes just for styling. This is terrible practice that I thought we'd stopped doing.