Tagged
design-principles
- Three Couplings You Cannot See, and a Dependency That Moved House
Coupling often gets reduced to counting imports. That holds up on the textbook violations and fails on production code. Replace a direct call with an event bus and two imports disappear, but the dependency has not gone anywhere. It has moved out of the compiler's sight.
- Cohesion: Six Levels, and Where Intuition Fails
Cohesion is usually defined as how similar the elements inside a module look. That reading survives the obvious violations and fails on production code: handlers that branch by refund channel have near-identical names, and still land in the lower half of the 1974 scale.
- Seven Design Principles Are Not a Pyramid
The seven principles of object-oriented design are usually drawn as a pyramid, each layer holding up the next. Check where each one came from and the picture falls apart: six unrelated groups of people, twenty-two years apart, and at least two of them give opposite advice about the same code. This is the opening note of the Programming Thinking series.