It is a book about how to refactor code efficiently and without pain. In it, we'll discuss the benefits of refactoring for development and business, explore how to search for problems in your code, and investigate possible solutions for those problems.
We will use code examples primarily in JavaScript and sometimes in TypeScript. However, the techniques we're going to discuss can be used in other high-level languages as well. So if you don't code in JS/TS but feel comfortable around them, you might find something that you can adopt to your language too.
- Preface
- Introduction
- Before Refactoring
- During Refactoring
- Low-Hanging Fruit
- Names
- Code Duplication
- Abstraction
- Functional Pipeline
- Conditions and Complexity
- Side Effects
- Error Handling
- Module Integration
- Generics, Inheritance, and Composition
- App Architecture
- Declarative Style
- Static Typing
- Refactoring Test Code
- Comments and Documentation
- Refactoring as a Process
- Afterword
- Cheat Sheet on Refactoring Techniques
- Sources and References
You can also read the book online or download it as a PDF or Epub:
Alex Bespoyasov, software engineer at 0+X, web developer since 2010.
All materials are © 2022 Alex Bespoyasov. The work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.