4 ms·
I think the metric should be branching, so functions with fewer branches are better than functions with more branches. And the reason is that it’s easier to wr
by chillfox 4y ago
I think the metric should be branching, so functions with fewer branches are better than functions with more branches.
And the reason is that it’s easier to write tests for functions with few branches without overlooking paths through the function. Same goes for reasoning, it’s easier to consider all paths through a function if there’s fewer.
I see number of lines as an imperfect proxy for complexity.
- 082349872349872 4y agoGenerally a good metric, but be aware that overapplication would ultimately result in linear searches: https://news.ycombinator.com/item?id=32507510 https://news.ycombinator.com/item?id=32507510