Summary
Here we are, at the end of this journey through refactoring techniques. We hope we’ve given you some ideas on how to craft methods better, making them clear and readable. We’ve explored how it can sometimes be helpful to shuffle features between objects and better organize your data. We’ve simplified conditional logic (you know – those if
statements and switches that help us solve problems quickly but can make our code unreadable!). We’ve simplified method calls, used a bit of good old generalization, and talked briefly about the immutability of objects. In the next chapter, we’ll dive into how to use automated tools to (hopefully!) make our code even better.