4 Design Principles
by Kent Beck
Damien Cassou, Stéphane Ducasse and Luc Fabresse
http://stephane.ducasse.free.fr
"Dady" Kent Beck
- Extreme Programming
- Agile Manifesto
- Test-Driven Development
.
The 4 Design Principles
- Passes the tests
- Reveals intention
- No duplication
- Fewest elements
I. Passes the Tests
- your code must work as intended
- the tests make sure that's always true
II. Reveals Intention
- the code must be easy to understand
- always remember that:
- you spend most of your time reading/browsing code
- if you can't understand, you can't modify
III. No duplication (''aka.'' D.R.Y.)
- Don't Repeat Yourself
- say things "Once and only once"
- create abstractions
IV. Fewest Elements (''aka.'' no over-engineering)
- don't design future requirements
- you don't know what you will need tomorrow, don't design for it today
- this only makes code harder to change
The 4 Design Principles
- Passes the tests
- Reveals intention
- No duplication
- Fewest elements
/