|
|
|
|
|
by hinkley
1938 days ago
|
|
Exploratory refactoring turns out to be very close to an exercise in creative writing, as I learned one day accidentally from my lit major friend. Take the section you are stuck on, print it out, cut it up into sentences or phrases, and just rearrange them until either it makes sense, or you figure out where you went wrong. Rearranging code statements until something makes sense is exactly what refactoring is. |
|
Refactoring is not merely rearranging code statements. Refactoring is restructuring of the code starting from the architectural and abstract goal and then looking at how pieces of existing code would fit. Sometimes, that requires writing new code and tests. Refactoring by definition also means not breaking the user space.
I've never heard of any serious writer printing out their prose and cutting it and rearranging it. That just sounds absurdly unnecessary to me.