3 ms·
One underrated problem with semantic naming and classic CSS is having to repeatedly do one of the two hardest problems in computing, that is naming things, 5 ti
by 1_player 5y ago
One underrated problem with semantic naming and classic CSS is having to repeatedly do one of the two hardest problems in computing, that is naming things, 5 times per minute while you're trying to be creative. You constantly have to context switch between "design/creativity" and "logic/pragmatism" mental modes. It's awful, exhausting and doesn't enable any state of flow. The productivity loss is enormous.
- LouisSayers 5y agoI think you're discounting the value of naming though. You don't refer to bananas as "the curved sweet yellow food that grows on trees", you simply refer to a banana as a banana. Sure, for one off items it might not make sense to name it but when you create design patterns then it's incredibly useful to be able to name things. Yes it may be hard and require you to think, but just because that is so does not make it bad necessarily.
- topspin 5y ago> "the curved sweet yellow food that grows on trees" You have (some variety of) cavendish bananas in mind. There are red, pink and blue bananas. They're not all sweet. The plants they grow in are not always "trees" but rather large fern like plants. And then that day arrives when you are required to style some variant of 'banana' you are forced to decide: do I break the world by messing with banana or do I make new-banana?
- LouisSayers 5y agoI'm definitely going to have to do some research on bananas after this lol. In CSS land however you wouldn't break the world for a different banana, you'd simply add another class for the variant and style appropriately. .banana { // generic banana styles } .banana.musa-velutina { color: pink; } Of course not all decisions are going to be as straightforward, but I do think that there's a lot of value in keeping a website's items consistent. The work upfront to name things and build out concepts will pay its dividends as you extend a site or build out new ones.
- deergomoo 5y agoIn my experience the “one-off items” are far more common, simply because every one thing I do reuse will typically have several child elements. Why am I naming the styles that represent the title of a contact card if I never use it outside of the contact card—which itself is probably included by referencing a file called “ContactCard.html” or whathaveyou. Of course, there’s no right or wrong answer here, and I suspect it very much depends on what type of web systems you are building. I feel the entire debate is basically a special case of the question “do you make websites or web apps”.
- hbn 5y agoYou can still call it a banana in Tailwind, but you'd do it with a component in your framework rather than a class name. If you plan on using bananas multiple times throughout your app, aren't you going to be pulling that out into a component anyway? So define that it's curved and sweet and yellow in that one place, and then insert an instance of it wherever necessary.