News for hackers. Stuff that matters.
Re:Tetris and The Power Of CSS by oneeyedpigeon on Monday November 11, 2013 @03:57AM (#6710655)
Is there a better way to solve the problem presented? Because I think the author does it with about the least amount of coupling possible, and that's to be applauded.
Re:Tetris and The Power Of CSS by peterhunt on Monday November 11, 2013 @04:45AM (#6710797)
The "last" class he mentioned is a better solution. His only reason against it was "complex template logic is bad". If you're using a sufficiently powerful system for managing the Dom it's usually much easier to manage the complexity of the "last" class. It's fast and easy to tell at first glance which styles will be applied, and refactoring is easy as a result.

His mention of separation of concerns is, IMO a common misunderstanding of what that term means. The coupling has to be made somewhere after all and it's better to choose the more performant and more explicit way.

Re:Tetris and The Power Of CSS by oneeyedpigeon on Monday November 11, 2013 @07:36AM (#6711271)
I'm not a big fan of the 'last' class approach since it's redundant and pollutes the markup. YES, it only does this to a very small extent, but when we're talking about which solution is 'better', I think it weighs pretty significantly. I don't see anything inherently tricky maintenance-wise in his approach.
Re:Tetris and The Power Of CSS by peterhunt on Monday November 11, 2013 @08:23AM (#6711426)
What happens when you change the structure of the markup? How do you know for sure which rules apply to the stuff you're changing?