Re:Special Cases Are a Code Smell
by ummonk on Friday January 25, 2019 @02:29AM
(#18996188)
I think where you can easily handle the edge cases, as done in the first and third` examples here, it's a good idea, because it's far easier to check correctness of the algorithm.
In the particular case you mentioned it's perfectly reasonable to explain why the array is getting padded in a code comment.
In the particular case you mentioned it's perfectly reasonable to explain why the array is getting padded in a code comment.