Cohesion and Coherence
Why this matters? #
A very good starting point vs all the principles and rules.
Cohesion vs Coherence #
definitions and meaning
| Cohesion | Coherence |
|---|---|
| low level | high level |
| to stick or stitch | organize or structure |
| construct to construct | Emergent |
| measurable | subjective, not measurable, creativity |
| Quantitative | Qualitative, expertise, hard to teach |
| more concrete | more abstract |
In Programming (OOP paradigm) #
Cohesion #
- How similar things are grouped
- How focused functions are
- Single Responsibility Principle At function and Class level
- How focused classes are
- how closely related functions are
- how tightly coupled are
Cohesion tools #
In Writing #
Cohesion tools #
In Ansible Configurations #
In Movies #
In Civil Engineering #
References #
https://www.educba.com/coherence-vs-cohesion/ https://ericnormand.me/podcast/keeping-functional-code-organized