Hacker News new | ask | show | jobs
by lucb1e 3219 days ago
Would be interesting to tie that to ratings. Have a diverse set of people read lots of code (samples from projects large and small, in different languages, etc.) and rate it on things like "easy to understand" and "easily extendible", then correlate that with styles. I'd be very interested in how I score and what I can improve.
1 comments

It sounds like you're talking about cyclomatic complexity.

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

There are tools out there for most major programming languages for measuring cyclomatic complexity. They can tell you whether typical coders will be able to help you work on your program at its current complexity level.

I heard of this but haven't seen it used anywhere outside of school. Do you have any experience whether this correlates with how readable people find code to be?
No, sorry. Actually, I feel like long functions are often clearer than refactored equivalents.
Okay, thanks for responding!