Few week ago I was fixing a small edge case bug in one of our products. Even before starting to fix the issue, I knew it will be one line of code chan

Solve software problems by adding more

submited by
Style Pass
2021-06-26 07:00:04

Few week ago I was fixing a small edge case bug in one of our products. Even before starting to fix the issue, I knew it will be one line of code change. So I did the fix & next day here come the QA report, because of that one line change I did, I have introduced 4 more edge cases which cause some inconsistancies. Then I started fixing those issues one by one, few hours later I managed to fix everything, but with several changes to the existing structure. In which there were few new local variables, added an optional parameter to a method, added one new state.

I started thinking is it worth all these new additions & added complexity for a small edge case bug. For few minutes I was thinking of negotiating with product team not to fix the initial edge case. Because it was not a critical bug & only cause UI inconsistency.

Then I revisited the initial bug & started from the begining again. Because now I know if I do one line change it will introduce few more edge cases, I took a different approach & managed to fix the initial bug without introducing any edge cases. Most importantly no new local variables or method parameter changes or new states. I continued thinking about what happened that day & even though it ended up well, there was a high chance I could have gone with all additional changes without realising there was a better way. So when I watched this Youtube video today morning, I knew that is exactly the same thing happened to me. I continued building more pieces without realising removing the first piece is the better solution.

Leave a Comment