2 Looking under the hood of refactoring

This chapter covers

  • Using readability to communicate intent
  • Localizing invariants to improve maintainability
  • Enabling change by addition to speed up development
  • Making refactoring part of daily work

In the last chapter, we took a look at the different elements involved in refactoring. In this chapter, we dive into the technical details to form a solid foundation of what refactoring is and why it is important from a technical perspective.

2.1 Improving readability and maintainability

We start by reiterating the definition of refactoring that we use in this book: refactoring is making code better without changing what it does. Let’s break down the two main components of this definition: making code better ...

Get Five Lines of Code now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.