Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Cyclomatic complexity has been used for decades as a measure of software quality. ( Less is better. ) Any discussion of "reducing code nesting", should include a mention of it.

http://en.wikipedia.org/wiki/Cyclomatic_complexity



Cyclomatic complexity (CC) is good as long as it doesn't become the end-all be-all measure of code. I've run into crazy types that use it as an abusive bludgeon.

Code that has low CC feels strange if you're not used to it, but there are some good reasons to like it. One of the things that I find appealing to it is that by putting things into named functions, you're better expressing your intent by giving it a name.


I couldn't agree more.

It more important to be aware of it than to live by it. We're all adults here. ( Well, most of us anyway. ) So, as long as we understand the tradeoffs, then we can decide for ourselves when the complexity is too great.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: