Summary
Speaking of refactoring, it is crucial to understand what needs to be refactored; in other words, it is necessary to distinguish good code from bad code. In this chapter, we have seen what is typically meant by good code, providing an overview of its characteristics. When these characteristics are lacking, it is likely that refactoring is needed. When discussing good code, we must also talk about Clean Code; we addressed this topic and learned how to recognize it and, hopefully, write it. Good code is usually also SOLID code, and we briefly touched upon the meaning of that as well. Lastly, after understanding what good code is, we investigated some causes of bad code; the hope is that you will be alert if you find yourself in one of the described situations.
In the upcoming chapter, we'll address a set of warning signs—elements in your code that should alert you and prompt contemplation on refactoring your code.