Skip to content
Veltoryx Technologies
ProLesson 2.3Beginner9 min readUpdated 31 October 2026

High Cohesion and Low Coupling

Learn the two words that describe almost every good or bad class design: cohesion, how well the parts of one class belong together, and coupling, how much one class depends on another.

Every experienced engineer judges a design by two questions, often without saying them aloud. First: do the things inside this class belong together? Second: how much does this class depend on others? The first question is about cohesion. The second is about coupling. If you can answer both for every class in your design, you can predict whether the design will be pleasant or painful to change.

01Two pictures from daily life

Cohesion is like a kitchen drawer. A good drawer holds only cutlery: forks, spoons and knives. You open it and know what is inside. A bad drawer holds a screwdriver, a birthday candle, three batteries, a spoon and an old bill. Every item is "in the kitchen", but nothing belongs together, and finding anything takes time.

Coupling is like how two appliances connect. A lamp with a plug can be moved to any socket in any room, and you can replace the lamp with another one in seconds. A lamp whose wires are soldered straight into the wall can never be moved, and changing the lamp means breaking the wall.

In software, a class is the drawer, and a dependency between classes is the wire.

Loading the rest of the lesson…