The flocking rules are an small set of rules for refactoring code. The idea is make small incremental changes that allows you obtein precise error messages when something goes wrong, so if you find and error, you can revert it and make a smaller one. The steps are the following:
- Select the things that are most alike.
- Find the smallest difference between them.
- Make the simplest change that will remove that difference.
- This concept was originally found at the book 99 Bottles of OOP by Sandi Metz & Katrina Owen.