Have you ever seen a pull request with half a dozen, seemingly unrelated changes, all in the name of fixing a specific bug?
The last time this happened to me, I requested clarification on the purpose of a number of the changes, suggested a couple small refactors, pointed out that a couple of the changes were unnecessary or even counter-productive…
After a few back-and-forths, the PR went from about 40 lines changed to 2 lines changed. All the unrelated, unnecessary bits had been removed.
This is the result of what I have come to call Guess-Driven Development.
It happens when someone doesn’t really know what’s causing a bug, so they just start changing things, until the bug goes away. Then they commit their entire change set, without much thought.
If you enjoyed this message, subscribe to The Daily Commit to get future messages to your inbox.
Top comments (1)
I think guessing is good but then after you made it work you would need to understand what fixed the bug and as you say remove unnecessary things.