News for hackers. Stuff that matters.
Re:I no longer build software by klodolph on Monday September 21, 2020 @10:56AM (#24544187)
Honestly, this IS better.

Separating the HTML, JS, and CSS is an approach that works up to a certain size/complexity app. When I’m working on some functionality, I need to be able to understand the relevant parts of the HTML, JS, and CSS. With a smaller app, one person can more or less grok the code base well enough to find everything they need. With simpler apps, you might have fairly uniform or boring styling and not a ton of CSS rules. If I’m setting something up with Bootstrap and just getting it working, I can probably ignore CSS for a LONG time.

If you’re working on something larger and more complicated, you really want to have all of the HTML, JS, and CSS for a particular piece of functionality right in the same place so you don’t have to go searching for it. It’s how you survive in large/complex apps. You’ll think, “The margins in this box are too large” and you want to be able to fix that without trying to grok some massive set of CSS rules, and when you do get the CSS rules that you want, you want to know that they’ll be delivered to the client—something that is easy if you deliver all of your CSS rules to every client, but hard if you want to split your CSS.

I think the only real tragedy here is that too many people are copying “the way Facebook does it” without wondering if Facebook might have a completely different set of priorities than they do.

Re:I no longer build software by gagege on Monday September 21, 2020 @01:31PM (#24546130)
I agree. I came to realize a few years ago how arbitrary the HTML, CSS, JS separation is. It makes sense if you think of the web as simply a set of documents (with progressive enhancement and all that), but we've gone way beyond that metaphor. If you're building a web app, separating the three is cargo-culting.