8. Refactoring
Demo
We are going to see how to
- Deal with long parameters list
- Split long methods
- Refactor a switch statement
9. Refactoring
Why should you
care?
When and when
not?
Two main reasons:
- Decrease the cost of change
- Make the code easier to
understand
When to refactor?
- TDD: Red, Green, Refactor
- To make room for change
- When you fix a bug
- As you do a code review
10. Resources:
➔ Code smells blog post by Ana Nogal
➔ Complex refactoring in simple steps Screencast by
Matthew Butt