Re:Don’t use IDs in CSS selectors? (2011)
by reverius42 on Wednesday November 19, 2014 @08:36PM
(#8633919)
Totally agree. I have found that most of the problems solved by separating CSS, HTML, and JavaScript weren't really problems to begin with, if you model your application views the way React does (as a render function that produces DOM tree based on external properties and internal component state). Somehow using multiple technologies (CSS for styling, HTML for markup, JavaScript for logic) got conflated with "separation of concerns", but true separation of concerns involves separating component A from component B. Encapsulating the entire component in JS actually helps cohesion.
Re:Don’t use IDs in CSS selectors? (2011)
by 1010 on Wednesday November 19, 2014 @12:35PM
(#8631362)
In my experience, "Don't use X at all" is very rarely, if ever, a suitable response to "X has some flaws".
Re:Don’t use IDs in CSS selectors? (2011)
by spion on Wednesday November 19, 2014 @12:42PM
(#8631399)
I agree, and I understand that such "radical" claims invite a dismissive reaction (downvotes). But the presentation really does make a very compelling argument and offers a simple and elegant alternative solution that solves most problems.
https://speakerdeck.com/vjeux/react-css-in-js
That presentation goes into more depth describing problems with CSS. Given a virtual DOM in JS, the solution becomes simple and obvious: plain objects.
Its interesting how React completely reinvents "best practices".