So You Want to Start Refactoring?
summary
Practical refactoring in Rails focuses on concrete moves: beef up test coverage and keep tests unchanged during the refactor so they stay a safety net, annotate and rename confusing bits (turn single-letter vars into meaningful names), simplify nested conditionals, and move front-end validation back to the client when appropriate. Use tools like RuboCop and Reek, commit frequently, break work into small deployable chunks, and expect a small signup-controller cleanup to snowball into broader changes once duplicated checks and unclear params get clarified.
AI-written summary · about
chapters (16)
- 0:00Intro
- 0:36About Me
- 2:08What is refactoring
- 3:33Why refactor
- 5:55Trust your gut
- 6:54Warning signs
- 7:40Testing
- 9:26Prepare
- 13:18Annotation
- 16:01Code messes
- 17:25Cleaning up code
- 21:29Case study
- 22:26Annotations
- 26:39Other Tips
- 28:30Two Ways to Refactor
- 30:41Things to Remember








