# Origin & Overview

### Uncle Bob & The Book

* [Clean Code book](https://petozoltan.gitbook.io/clearcode/clean-code/clean-code-outline) <img src="https://2662009507-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M1Cc_hcV3kt58baLlJP%2F-M1fWTAgd23ZOK2rnlJu%2F-M1fWXiUcG6NuCZSWuw5%2Fclean-code-book-cover.png?alt=media&#x26;token=b9107954-86e2-4758-a89e-db26dfbdfd38" alt="" data-size="line">&#x20;
* Robert C. Martin a.k.a. *Uncle Bob* <img src="https://2662009507-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M1Cc_hcV3kt58baLlJP%2F-M7mrwNpTYYSBVZTrHvV%2F-M7mtpto8WHCTtAtfJzx%2FUncle_Bob_400x400.png?alt=media&#x26;token=f78fe32d-fa9d-4960-aea6-de6cafc5d7c8" alt="" data-size="line">&#x20;

### Named principles

* In the book: SRP, OCP, DIP, (IoC), DI, DRY, LOD, BSR, F.I.R.S.T.
* Not in the book: LSP, ISP, YAGNI, KISS, S.O.L.I.D.

Coding

* **SRP** Single Responsibility Principle
* **OCP** Open Closed Principle
* **DIP** Dependency Inversion Principle
* **(IoC)** Inversion of Control
* **DI** Dependency Injection
* **DRY** Don't Repeat Yourself
* **LOD** Law of Demeter
* **BSR** Boy Scout Rule
* **LSP** Liskov Substitution Principle
* **ISP** Interface Segregation Principle
* **YAGNI** You Ain't Gonna Need It
* **KISS** Keep It Simple Stupid
* **S.O.L.I.D** SRP + OPC + LSP + ISP + DIP

Testing

* **F.I.R.S.T.** Fast, Independent, Repeatable, Self-validating, Timely

### Why clean code?

* [The total cost of owning a mess](https://petozoltan.gitbook.io/clearcode/clean-code-outline/why-clean-code#technical-debt) <img src="https://2662009507-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M1Cc_hcV3kt58baLlJP%2F-M1fWTAgd23ZOK2rnlJu%2F-M1fWXieduUp2uGbybE9%2Fvelocity-graph.png?alt=media&#x26;token=891fbb7b-e52f-414a-9c80-a1e76ecc66c5" alt="" data-size="line">&#x20;
* [The real measure of code quality](https://petozoltan.gitbook.io/clearcode/clean-code-outline/clean-code#possible-measurements) <img src="https://2662009507-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M1Cc_hcV3kt58baLlJP%2F-M1fWTAgd23ZOK2rnlJu%2F-M1fWXiX5DDYJbGdYSxM%2Fcode-quality-wtfs.png?alt=media&#x26;token=91a94f4e-816d-46ee-ac80-e6c6a73150e9" alt="" data-size="line">

### What is bad code like?

Readability

* Spaghetti code
* Dependencies
* Fragile code
* Unreadable
* Mind mapping
* Duplication&#x20;
* Unexpected
* Magic numbers
* Overcomplexity
* Code smell
* Antipatterns
* Technical debt

Functionality

* Bugs
* Does not fulfill the specification
* Side effects

Programmer style

* Careless
* Sloppy
* Lazy
* Quick and dirty

### What is clean code like?

* Elegant
* Simple
* Direct
* Readable
* Expressive
* Carefully written
* Tested
* Bugs cannot hide
* Art


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://petozoltan.gitbook.io/clearcode/clean-code/clean-code-introduction/origin-and-overview.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
