Please enable JavaScript.
Coggle requires JavaScript to display documents.
LevelUp - Coggle Diagram
LevelUp
-
-
Refactoring
Quotes
Before refactoring, make sure you have solid tests for this feature. - Martin Fowler
"Any fool can write code that computer can understand. Good programmers write code that humans can understand." - Martin Fowler
Extract Function.
When you have an insight about the code, persist it in the code by extracting to a function and name it properly (with what it does). - Martin Fowler
-
-
-
Refactor before adding feature.
When you have to add a feature but the code is not well structured, first refactor to make it easy to add feature and then add the feature. - Martin Fowler
-
Habbits to gain
- read the code
- gain some insight
- use refactoring to move that insight from your head back into the code.
Check list: ==> Add structure to the code
- decomposing the original function into a set of nested functions
- Split Phase to separate the calculation and formatting the result
- introduce a polymorphic service
2 Hats (or activities)
Adding functionality
During this, don't change existing code. Add new capabilities. Add tests.
refactoring
Don't add functionality. Only restructure the code. Add tests only if missing tests. Only change tests to accomodate a change in an interface.
Best practices
TDD
-
Réécrire notes TDD, personnel
-
-
-
-
-
-
-
-