Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Tell that to a decent number of people I have worked with over the past 20 years. In fact, I know people to this day who have been writing CSS for decades who don't really know fundamental things like specificity, inheritance, or the cascade. Pattern matching into the sunset, not a single fundamental piece of CSS specifications ever internalized, still getting paid (its okay).

https://www.w3.org/Style/CSS/specs.en.html

You can read this and know most things about CSS. For a bit anyway. You'll forget things you don't use. You might remember them again one day.



I tried to use a framework on a web project recently, but looking at the two most popular frameworks... one of the results in every site looking the same, while the other is a step backwards to the bad old days in the worst possible ways. It was simpler to start from scratch, and I finally understood the cascade. I was actually able to drop most of the explicit class attributes, which led to a significant reduction in page size.

The primary purpose of frameworks was to work around the quirks in all the different web browsers out there, and to implement grid-like layouts before we had css grid, and to deal with the impossibility of centering a div natively. None of that is necessary these days, and hasn't been for a decade.


Atomic CSS is great. It does abuse class="" in the same way style="" was abused. It's counter-intuitive but the obvious code smells produced here are better than the non-obvious code smells created by other style architecture approaches.

I've always now-and-then packaged up and open-sourced the pattern I use for CSS. The projects have gotten smaller and smaller. This reflects well on CSS as a technology.

I think class="" has more to offer in an information density sense. There's more potential there than style="" had. Instantly lumping them together was my first response too, but I was wrong. The in-the-HTML shorthand of frameworks like Bootstrap/Tailwind/CASS is insanely useful in a way that inline styles never were.


One reason I think Tailwind became so popular is that it makes it much easier to pattern match CSS. I don't think it's a good or bad thing, it's just a thing.


Yeah, I am not saying its bad in all applications, just that people who use CSS these days rarely really know CSS (who can know it all?), which isn't really any different from the past on a general level. Yet, I think we should push our peers to view the entirety of CSS as meaningful and worthy of attention.


I'm forcing myself to use raw CSS in my recent work just so I can gain a better understanding of it. It's nice what you can achieve without JS, but man sometimes it just feels like arranging arcane symbols until you achieve the desired result.


Can you explain what you mean by pattern matching? I’m not sure I understand.


Do you know what pattern matching is?

https://en.wikipedia.org/wiki/Pattern_matching

Also:

https://en.wikipedia.org/wiki/Pattern_recognition

And (early 2000s skeptics idea of the term, a useful abstraction):

https://www.youtube.com/watch?v=1AjLmU0Sfu4

Sometimes people call it:

https://en.wikipedia.org/wiki/Cargo_cult_programming

All just to say, w.r.t. CSS, if you are doing this, you don't really understand what you are doing, why browsers added a feature, what the language is, you are just replicating patterns because you saw other people do it.

You were assimilated into behaving a certain way, and you continue to look at the patterns your org or community follow and you just are a victim of the https://en.wikipedia.org/wiki/Bandwagon_effect or you never had time to learn and you are a https://en.wikipedia.org/wiki/Script_kiddie or https://en.wikipedia.org/wiki/Lamer (or what people used to refer to as hackers outside of IT).

You know you can do it, but you don't know how it works, why it matters, or why you should care.

Meanwhile, you can learn about these patterns, study them, comment on why people use them, critique their flaws, benefits, etc.

Those people used to be called a https://en.wikipedia.org/wiki/Software_architect or one who studied https://en.wikipedia.org/wiki/Sociology


Oh I see, thanks. I knew what pattern matching was, but took it literally and confused myself.





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: