What is the meaning of 'high cohesion'?
- by Max
I am a student who recently joined a software development company as an intern. Back at the university, one of my professors used to say that we have to strive to achieve "Low coupling and high cohesion".
I understand the meaning of low coupling. It means to keep the code of separate components separately, so that a change in one place does not break the code in another.
But what is meant by high cohesion. If it means integrating the various pieces of the same component well with each other, I dont understand how that becomes advantageous.
What is meant by high cohesion? Can an example be explained to understand its benefits?