What is the meaning of 'high cohesion'?

Posted by Max on Programmers See other posts from Programmers or by Max
Published on 2012-08-31T02:43:59Z Indexed on 2012/08/31 3:49 UTC
Read the original article Hit count: 264

Filed under:

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?

© Programmers or respective owner

Related posts about programming-practices