News for hackers. Stuff that matters.
Re:Maintainability Through Colocation by ummonk on Wednesday October 16, 2019 @08:54PM (#21277899)
Very much agree with this, and I tend to make similar decisions, including strongly preferring CSS in JS frameworks.

The one item I'd caveat though is colocation of state. The author is right that often it is best to colocate state with the component that needs it. On the other hand though, often the state cannot be decoupled in this way and you have interactions between states of different components; in these cases, it is often better to colocate all the state together in one place. That is the essence behind e.g. stores like redux in web programming.

There are no comments on this comment yet.