2 ms·
> Follow good rules of thumb like keeping methods short, reuse code rather than cutting and pasting, and write unit tests (and, of course, use spaces and not ta
by vbezhenar 7y ago
> Follow good rules of thumb like keeping methods short, reuse code rather than cutting and pasting, and write unit tests (and, of course, use spaces and not tabs). Otherwise, all code is as clean as all other code.
You can find people who'll disagree with you on every point in this list. So yeah, nobody agrees what "clean code" looks like.
- bluGill 7y agoI agree with everything in the list. I have also seen clean code that violates every item in the list. I also have seen bad code that follows every item in the list.
- mumblemumble 7y agoFWIW, at least according to Hillel Wayne's summaries of the state of our knowledge on this stuff (www.hillelwayne.com), all three of those have been studied, and the only one that's been shown to be clearly beneficial is unit tests. (Not TDD, mind. It apparently doesn't matter much whether you write tests first or second, just that you write them at all.)