Hacker News new | ask | show | jobs
by marrs 3889 days ago
I tend to avoid nesting as well now.

Wrt your modularisation, that seems like a reasonable approach, although where do rules go if you have nested components?

From my experience, modularity really starts to bite when you also have inheritance.

For a simple case, you have a module A that contains class rules that are used as prototypes for rules in other modules. You want to modify behaviour. Where do you modify it, in the prototype or in the subtype? The answer isn't always obvious and sometimes 2 conflicting answers can be correct depending on the metaphor used for deciding how to modularise.

That's a simple case. A complex could be one where module A extends class rules from module B and module B extends class rules from module A. What happens when two rules extend each other? I've seen this in action, by the way. The SASS compiled without error so one presumes that there is a limit put on the recursion.