I’ve been refactoring on some very brittle, poorly-written code lately. One method I like to use in a situation like this is the “Mikado Method”, as described in the book by the same name.
But the gist of it is that it’s a system of quick, iterative experimentation for rapid, but safe changes to code.
- Set a goal (e.g. add a new feature to the web service)
- Experiment and break things (e.g. try the first thing that comes to mind to move toward your goal)
- Visualise (e.g. write down the things that broke in a “Mikado diagram”)
git reset HEAD)
The breaking pieces in step 2 become new goals, then you repeat. Eventually, your experiments won’t break things, and they become final code that you commit, and mark off of the diagram.
This practice can apply to non-coding activities, as well. For example in a my (very low-production quality) video of a workshop I did, we apply this practice to increasing sex appeal!
If you enjoyed this message, subscribe to The Daily Commit to get future messages to your inbox.