Hacker News new | ask | show | jobs
by ycmbntrthrwaway 3219 days ago
It is not about tabs, spaces and variable names. The main difference is how long your functions are, how many functions they call, how deep control structures within functions are etc.
2 comments

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.
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!
My style changes over time.
As long as it changes gradually, or partially, that might not matter.