Overview - Coupling and cohesion
What is it?
Coupling and cohesion are two fundamental concepts in software design that describe how parts of a program relate to each other. Coupling measures how much one module depends on another, while cohesion measures how closely related the tasks within a single module are. Good software design aims for low coupling and high cohesion to make programs easier to understand, maintain, and change.
Why it matters
Without understanding coupling and cohesion, software can become tangled and hard to fix or improve. High coupling means changes in one part can break many others, causing bugs and delays. Low cohesion means modules do too many unrelated things, making them confusing and error-prone. By mastering these concepts, developers create software that is more reliable, flexible, and easier to work with.
Where it fits
Before learning coupling and cohesion, you should understand basic programming concepts like functions, modules, and how code is organized. After grasping these ideas, you can explore software design principles, design patterns, and architecture styles that build on coupling and cohesion to create robust systems.