5 ms·
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 appl
by oneeyedpigeon 13y ago
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.
- peterhunt 13y agoThe "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.
- oneeyedpigeon 13y agoI'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.
- peterhunt 13y agoWhat happens when you change the structure of the markup? How do you know for sure which rules apply to the stuff you're changing?