> For the complete documentation index, see [llms.txt](https://hanfak.gitbook.io/workspace/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hanfak.gitbook.io/workspace/general-paradigms/programming-types/oop-design/clean-code/clean.md).

# CLEAN design

* An object should have
  * Well defined characteristics
  * focused responsibilities
  * hidden implementation
  * In charge of it's state
  * Defined only once
* CLEAN stands for
  * Cohesive
  * Loosely Coupled
  * Encapsulated
  * Assertive
  * Non redundent
* Code quality is about keeping the relationship between objects intentional and clear
* Best code is written thinking about the programmers that come after.
  * We aren’t supposed to create things that stand the test of time, just the test of profit
    * Doing something that lasts forever at the first go is so expensive that it isn’t worth it, but focusing only on short-term profit will create code that collapses under its own weight.
  * Need a middle ground
  * to take the existing codebase and slowly reshape it to make it manageable again
