First, we find a section of code that contains different operations, such as initialization and print. We can try to refactor that extracts them into functions.
Concepts
- The process of restructuring code, while not changing its original functionality.
- Easier to understand
- Cheaper to modify
1 | using System; |
Now, We extract the different operations into functions, and each function just do one thing. We can more easily control something we want to do.
- Extract the different operations into functions.
- Add the summary.
- Remove the unused parameter.
1 | using System; |
In conclusion
Finally, we did it that finished the refactoring and just made it easy to maintain and read.