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

CSS and Javascript aren't concerns, they're technologies, and separation of technologies isn't a software engineering principle. "Concern" is pretty undefined in general. If anything, they're all part of the "view" concern. It's the same reason why JSX doesn't violate separation of "concerns."


I disagree.

You're being obtuse. JavaScript is used for more than presentation.


Moving goalposts is not a concern either. CSS and Javascript are concerns, becaus HTML is of content/structure, CSS is for styling and JS is for behaviour. Of course somewhere along the road devs thought that HTML and CSS are to primitive to spend any time learning them properly, because of that they later found them to bee too complex and we ended up in the mess we are right now, when we try to hide the lack of understanding under multiple wraps of abstraction.


I don't think it's that clear cut, you can define all sorts of behavior with both HTML and CSS, and there's no semantic meaning in `<div>`, which itself changes page style due to its layout properties. I don't know what goalposts are being moved, React/css-in-js have never violated separation of concerns. After all, css-in-js produces CSS, and React produces HTML. Separation of technologies isn't a principle, but DSLs are a well established pattern.


Is complexity a drawback?


What?


I believe any extra layer between intention and result will create extra complexity.

CSS in JS just isn't required a lot of the time. We have more mature methodologies available.


> CSS is for styling

The web has never lived up to that ideal. Sometimes you need to add a wrapper div with no semantics to make your layout work. Sometimes you need some Javascript to do a special layout CSS doesn't support or work around some other limitation. I've never seen a project that actually had meaningful "separation of concerns" based on technology, whereas almost every componentized project has at least decent separation of concerns along the component axis -- where you can drop a component into a design without thinking about it's internals at all.


We are not living in a world of absolutes. To put it simply, being able to replace the presentation layer _easily_ is a benefit to many projects

> I've never seen a project that actually had meaningful "separation of concerns" based on technology.

With respect, you just need to look a little harder.

I've used react libraries which are fundamentally tied to their styling, due to the fact they use CSS in JS.

Applying custom styling has been more difficult than it should have been.


I agree, I don't know why you're being downvoted.




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

Search: