Andrew's Digital Garden

Colocation

Colocation boils down to a simple concept: place code as close to where it's relevant as possible. Alternatively, things that change together, should be placed together [[20200307101703-easy-to-change]]

This simply makes things easier to maintain. It's easier to map where your dependencies are, it's easier to find related code, it's easier to delete things all at once.

Some examples of co-location:

  • CSS-in-JS keeps CSS near your JS/components
  • React keeps your view logic and templates together
  • Tests in the same folder as your code
  • State
  • Documentation

Keywords: co-location

[[concepts]]

Colocation