12 ms·
>The early return rule is easy to check, but what about a "don't write code with a mental load so high that nobody will be able to understand it next year" rule
by rcxdude 3y ago
>The early return rule is easy to check, but what about a "don't write code with a mental load so high that nobody will be able to understand it next year" rule?
Ah, you mean cyclomatic complexity! we have a tool that can check that. It definitely always means a function is too difficult to understand if the cyclomatic complexity is above some arbitrary value and would be safer it is was split up! No exceptions or nuance there!