Applying the Linus Torvalds “Good Taste” Coding Requirement
301–302 of 302 posts
Re: Applying the Linus Torvalds “Good Taste” Coding Requirement
#302Earlier quoted context omitted.
I agree partially w.r.t. testability of branchless code, but there's a flipside too: often the root cause of an edge case is in data-structure shape, so full coverage isn't necessarily sufficient. In other words, if an edge case is "folded into" the normal path via something like Linus' trick, you still need to actually test the case where (in this example) `head` is being removed, or else you aren't certain that the…
Yes, this is a good point. I had thought of this too and somehow convinced myself that the "head" case disappeared (since the non-"head" case would fail if "indirect" weren't initialized properly), but I'll admit that's a shaky argument.
Something we can all strive for professionally and while commenting on HN.