Comparison
CohesionvsGod object
Cohesion
the code for one job is spread over four files, and each of those files also does three unrelated jobs.
How much the things inside one module belong together. High cohesion means a module has one reason to exist and everything in it serves that reason; low cohesion means the module is a drawer. It matters because cohesion is what makes a boundary findable: when the code that changes together lives together, a feature is one file to open rather than a search across the repository.
Full entry →God object
one class is four thousand lines and every feature branch touches it.
One class or module that knows about and does far too much, so every change goes through it. It is the extreme of low cohesion and it has a distinctive organisational symptom: it is the file with the most merge conflicts and the one nobody wants to review. Splitting one is usually a months-long project, which is the argument for noticing at eight hundred lines rather than at four thousand.
Full entry →