Refactoring Code Flow and Iteration
While other chapters in Part 1 focus on refactorings that can be applied to entire methods or classes, this chapter focuses on improving the readability and efficiency of individual lines of code.
Developers spend the majority of their time reading over individual lines of code and only a fraction of that time modifying code. So, it is important to make our lines of code as maintainable as possible.
In this chapter, we’ll explore the following topics related to improving small pieces of code:
- Controlling program flow
- Instantiating objects
- Iterating over collections
- Refactoring LINQ statements
- Reviewing and testing our refactored code