Clean Code
Recommended Books
- Working Efficiently With Legacy Code
- User Stories Applied For Agile Software Development by
Mike Cohn
SOLID principle
- Single responsibility principle
- a class should have only a single responsibility (i.e. changes to only one part of the software’s specification should be able to affect the specification of the class)
- Open/closed principle
- software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification
- Liskov substitution principle
- objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program.
- See also design by contract
- Interface segregation principle
- Dependency inversion principle
SOLID
Three laws of TDD:
- Write failing test first
- Write only enough test to fail
- Write only enough code to pass
If the test gets more specific, the code gets more generic.
Transformation List
- Null
- Null to constant
- Constant to variable
- Add computation
- Split flow
- Variable to array
- Array to container
- If to while
- Recurse
- Iterate
- Assign
- Add case