3 ms·
The way I evaluate if a recommendation is good or bad is how it filters bad code. The 4 most important things for me to keep under control are: 1) Length 2)
by partycoder 10y ago
The way I evaluate if a recommendation is good or bad is how it filters bad code.
The 4 most important things for me to keep under control are:
1) Length
2) Cyclomatic complexity
3) Shared mutable state
4) Coupling
If you keep those under control, the rest of the maintainability will come by itself. e.g: testability, reusability, thread safety, security and other high level goals are easier when these low level requirements are met.
And, of course, consistency. Make sure that things do what they say they do. e.g: make sure the purpose of a variable or function can be explained only through its signature without requiring to look at the code.