> For the complete documentation index, see [llms.txt](https://petozoltan.gitbook.io/simplecode/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://petozoltan.gitbook.io/simplecode/clean-code/clean-code-outline/refinement-and-refactoring.md).

# Refinement & Refactoring

### Successive Refinement

* Write a draft or "monolith" first
* Refine/refactor it

### Coding Cycle

* Think
* Code
* Think again
* Optimize/refactor

### Modifications

* Refactor first, write code after that
* Change the "pseudo code" first, the real code after that
* Refactor to isolate changed part

### Refactoring

* Refactoring is good, technical debt is bad
* Refactoring is a mandatory part of the iterative development
* Continuously refactor unclean code to clean code
* Always refactor for changes in the requirements - *"Until now the program had to do this, from now on the program has to do that"*

### Design Patterns

(Not part of this training. See links.)
