General
- The Ten Commandments of Refactoring • Armand Halbert 📖
- Don’t Make This Mistake • Don’t spend so much time repeatedly refactoring the same code you end up not making progress; learning to move on when code is “good enough” is important • The Primeagen 📺
- Refactoring: clean your code • Refactoring Guru 📖
Examples: Grouping things together
- Python Refactoring: From Long List of Arguments to Object • Prefer grouping function arguments into a single object to make calling the function simpler (especially when the arguments are related) • Pybites 📺
- Python Refactoring: From Functions to Classes for Efficient Coding • Start by writing functions, but consider grouping into a class if you notice a set of functions that take similar arguments and refer to similar data • Pybites 📺
- Mastering Python Refactoring: Simplifying Code with the Dictionary Dispatch Pattern • Replace a series of conditionals with a lookup object (even if the values are functions) • Pybites 📺
Inbox
- Good Refactoring vs Bad Refactoring • Explains how refactoring poorly can do way more harm than good and I have definitely been guilty of falling into a number of those traps • Builder.io 📖