Trusted answers to developer questions

Definition: High cohesion

Get the Learn to Code Starter Pack

Break into tech with the logic & computer science skills you’d learn in a bootcamp or university — at a fraction of the cost. Educative's hand-on curriculum is perfect for new learners hoping to launch a career.

High cohesion is a software engineering concept that refers to how closely all the routines in a class, or all the code in a routine, support a central purpose. Classes that contain strongly related functionalities are described as having high cohesion; the heuristic goal is to make cohesion as high as possible.

In other words, cohesion represents the degree to which a part of a codebase forms a logically single and atomic unit. Therefore, in essence, high cohesion means keeping parts of a codebase that are related to each other in a single place. A general rule of thumb is to make sure that any software has high cohesion.

High cohesion is often paired up with loose coupling.

RELATED TAGS

high
cohesion
jargon
Copyright ©2024 Educative, Inc. All rights reserved
Did you find this helpful?