This is a cautionary tale about a) commenting non-obvious code and b) adding tests. Someone had to think hard about how to solve this problem. Everyone coming after shouldn’t have to. I must always be able to do drive-by refractoring with just seconds of thought. If tests are green and quick manual validation doesn’t show anything broken - then I’ll assume the refactoring was ok.
The job isn’t to make something work. It’s to make it work AND be resilient to a bad refactoring. If you didn’t properly protect your implementation with tests and comments you didn’t implement it at all.
The job isn’t to make something work. It’s to make it work AND be resilient to a bad refactoring. If you didn’t properly protect your implementation with tests and comments you didn’t implement it at all.