News for hackers. Stuff that matters.
Re:Please do not attempt to simplify this code by projektfu on Friday December 28, 2018 @08:11AM (#18776509)
Since we're referring to Bob Martin, I suspect the answer is through a functional test that captures that requirement. Thus, if a naive editor makes a change that breaks the requirement, it will not pass the test and cannot be committed to mainline.
Re:Please do not attempt to simplify this code by detaro on Friday December 28, 2018 @08:19AM (#18776530)
That catches a change, but doesn't give the reader the answer for why the code is like it is until they find the right test.
Re:Please do not attempt to simplify this code by projektfu on Friday December 28, 2018 @10:30AM (#18777249)
True enough, but in my limited experience it's more likely that such little requirements are hidden in code (and possibly commented) than that they have been properly captured by specifications and tests.