Books & Videos

Table of Contents

  1. Chapter 1 What Is Refactoring?

    1. How Can You Guarantee Behavior Doesn’t Change?

    2. What Is the Point of Refactoring if Behavior Doesn’t Change?

    3. What Is and Isn’t Refactoring

    4. Wrapping Up

  2. Chapter 2 Which JavaScript Are You Using?

    1. Versions and Specifications

    2. Platforms and Implementations

    3. Precompiled Languages

    4. Frameworks

    5. Libraries

    6. What JavaScript Do You Need?

    7. What JavaScript Are We Using?

    8. Wrapping Up

  3. Chapter 3 Testing

    1. The Many Whys of Testing

    2. The Many Ways of Testing

    3. Tools and Processes

    4. Wrapping Up

  4. Chapter 4 Testing in Action

    1. New Code from Scratch

    2. New Code from Scratch with TDD

    3. Untested Code and Characterization Tests

    4. Debugging and Regression Tests

    5. Wrapping Up

  5. Chapter 5 Basic Refactoring Goals

    1. Function Bulk

    2. Inputs

    3. Outputs

    4. Side Effects

    5. Context Part 1: The Implicit Input

    6. Context Part 2: Privacy

    7. Wrapping Up

  6. Chapter 6 Refactoring Simple Structures

    1. The Code

    2. Our Strategy for Confidence

    3. Renaming Things

    4. Useless Code

    5. Variables

    6. Strings

    7. Working with Arrays: Loops, forEach, map

    8. Wrapping Up

  7. Chapter 7 Refactoring Functions and Objects

    1. The Code (Improved)

    2. Array and Object Alternatives

    3. Testing What We Have

    4. Extracting Functions

    5. Streamlining the API with One Global Object

    6. Wrapping Up

  8. Chapter 8 Refactoring Within a Hierarchy

    1. About “CRUD Apps” and Frameworks

    2. Let’s Build a Hierarchy

    3. Let’s Wreck Our Hierarchy

    4. Inheritance and Architecture

    5. Has-A Relationships

    6. Inheritance Antipatterns

    7. Wrapping Up

  9. Chapter 9 Refactoring to OOP Patterns

    1. Template Method

    2. Strategy

    3. State

    4. null Object

    5. Wrapper (Decorator and Adapter)

    6. Facade

    7. Wrapping Up

  10. Chapter 10 Asynchronous Refactoring

    1. Why Async?

    2. Fixing the Pyramid of Doom

    3. Callbacks and Testing

    4. Promises

    5. Wrapping Up

  11. Chapter 11 Functional Refactoring

    1. The Restrictions and Benefits of Functional Programming

    2. The Basics

    3. Advanced Basics

    4. Burritos

    5. Learning and Using Burritos

    6. Moving from OOP to FP

    7. Wrapping Up

  12. Chapter 12 Conclusion

  13. Appendix Further Reading and Resources

    1. Origins of Refactoring

    2. Baseline JavaScript(s)

    3. Keeping Up with JavaScript

    4. JavaScript Reference

    5. Object-Oriented Programs/Patterns (Including Anticlass Stances)

    6. Async

    7. Functional

    8. Tools

    9. Non-JS-Specific but Relevant Sources

    10. Me