Refactoring JavaScript Notes

Originally published on , last updated on .

This is the associated notes and list of references for my Tips and Tricks for Refactoring JavaScript Applications talk. Interested in having me present this at your meetup? Email me at brandon at brandonmorrison dot com.

What is Code Refactoring?

Refactoring: a change made to the internal structure of software to make it easier to understand and cheaper to modify without changing its observable behavior. -Martin Fowler

In other words, intentional code changes that don't affect an applications outside behavior.

We do this for a few reasons...

What Do I Need to Get Started?

Refactoring a codebase is a team sport. Making anything beyond trivial changes to a codebases needs coordination with your entire team to ensure that everyone is on the same page.

General Strategies

Selling/Calculating ROI for Refactoring

Every situation is going to be different. In organizations that have leaders with strong engineering backgrounds, the question might not be "Should we our code at all?" but "When and which parts of our code should we refactor?"

In general, the choice to refactor parts of a codebase boils down to what is the return on investment of refactoring said code.



Convincing Your Boss Files/2016-JSS Technical Debt_d793c712-5160-4aa9-8761-781b444cc75f.pdf

Reference Books

Refactoring: Improving the Design of Existing Code By Martin Fowler

JavaScript Patterns By Stoyan Stefanov

Growing Object-Oriented Software, Guided By Tests by Steve Freeman and Nat Pryce

Refactoring (Ruby ed):

Ruby Patterns:

Practical Object-Oriented Design: