You must log in or register to comment.
As a software engineering researcher, I strongly agree. SE research has studied code comprehension for more than 40 years, but for that amount of time, we know surprisingly little about what makes really high-quality code. We are decent in saying what makes very bad code, though, but beyond extreme cases, it’s hard to come to fairly general statements.
Genuinely curious - what do we know makes code very bad?
A few bad things in code for which we have fairly consistent evidence:
- high nesting depth
- meaningless or single-letter variable names
- lots of code duplication
- very inconsistent formatting
- very complicated Boolean conditions with AND and OR
- functions with a lot of parameters