Cohesion & Coupling
Cohesion measures how closely related the responsibilities within a module are. Coupling measures how dependent modules are on each other. Aim for high cohesion and low coupling.
Cohesion & Coupling = a kitchen. High cohesion: all baking tools in one drawer (related things together). Low coupling: the oven doesn't need to know about the dishwasher to work. When your toaster requires the blender to be on, you've got a coupling problem.
High cohesion: a class does one well-defined thing; its methods all work with the same data and serve the same purpose. Low coupling: a class knows as little as possible about other classes; it depends on abstractions (interfaces) rather than concretions. The two are related: high cohesion naturally limits coupling because a focused class has fewer reasons to reach into other classes.
Types of coupling (low to high): data coupling (share only necessary data), stamp coupling (share data structures), control coupling (one module controls another's logic via a flag), common coupling (shared global state), content coupling (one module directly modifies another's internals). Types of cohesion (low to high): coincidental (arbitrary grouping), logical (logically similar but unrelated), temporal (done at the same time), procedural (sequential steps), communicational (same data), sequential (output of one is input of next), functional (single well-defined purpose). Aim for functional cohesion. The Law of Demeter formalizes low coupling: a method should call only methods on its direct collaborators, not on the results of those calls ('talk to your friends, not your friends' friends'). Violations: order.getCustomer().getAddress().getCity() — Order is coupled to Customer, Address, and City.
I think of cohesion as 'does this class have a clear identity?' and coupling as 'how many things does it need to know about?' A class with high cohesion has methods that all operate on the same data and tell a single story. A class with low coupling talks to abstractions, not concretions, and does not reach through objects to get to data (Law of Demeter). When I see a class with 20 fields and methods scattered across unrelated concerns, that is low cohesion — I split it. When I see a class that imports 15 other classes, that is high coupling — I introduce interfaces or a mediator.
Low coupling does not mean no coupling. Every system must couple somewhere — the goal is to couple at stable abstraction points (interfaces, events) rather than volatile concretions. Zero coupling means zero collaboration, which means nothing gets done.