Konmari Your Code: Finding Joy in Refactoring

By Becca Bailey

Elevator Pitch

There’s something deeply satisfying about refactoring React components. But nothing kills your joy like unintentional changes to existing functionality! This talk will cover some strategies for making refactoring a less painful experience for all of us.

Description

There’s something deeply satisfying about refactoring React components. Refactoring can help us to simplify, create a foundation for the future, and better communicate our intentions for our codebase. But nothing kills your joy like unintentional changes to existing logic! This talk shares some tips and tricks for stress-free refactoring, like aiming for simplification of logic over premature abstraction, and testing behavior without getting bogged down in implementation details. With a little bit of time and intentionality, we can keep the code that brings us joy and refactor all the rest.

Notes

Like a lot of other software developers, I have done a lot of “refactoring”, but haven’t always done it well. I have tried to refactor code bases that were hastily written without tests, and run into a lot of difficulties along the way. In my experience, learning to refactor well is a vital, but often overlooked skill.

General outline:

  1. What is refactoring?
  2. Why should we do it?
  3. How do we do it?
    1. Integration testing - documenting and testing existing behavior
    2. Renaming and cleaning up component props
    3. Removing messy conditional logic