What trick/pattern/concept/whatever did you adopt that has improved your code quality?

Emerald_Knight
Mon, 21 May 2018 06:11:50 +0000

One big thing that has made maintenance of my older code easier has been considering the concept of cyclomatic complexity. In particular, limiting conditional checks to exceptional cases as much as is reasonable has made it easier to focus on the "happy" path of code execution and easily track down the errors, and the limited nesting depth has made things easier to read as well. Overall, my code remains relatively flat and I'm not branching through layers of logic trying to track down a simple bug.

What are some simple things you do to keep your code from being a massive headache long-term?

Comments URL: https://tildes.net/~comp/l3/what_trick_pattern_concept_whatever_did_you_adopt_that_has_improved_your_code_quality

Votes: 26

Comments: 36