202204272307 Code that changes together should live together
A simple concept that drives good code organization and ensures we’re abiding by the principles that 202204272308 Modules should be highly cohesive and 202204272309 Modules should be loosely coupled.
If changing one piece of code requires another piece of code to change:
- They should be in the same module or else they would have low cohesion and high coupling.
- They would require less mental bandwidth to understand if they were physically near each other in the filesystem.
- We will be less likely to forget to update one piece when updating the other if they’re near each other and part of the same module.