Settings

Theme

Is there a readability metric for source code?

1 points by aratno 6 years ago · 1 comment · 1 min read


I’m imagining something like the Flesch-Kincaid test for source code: https://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_tests

I’m assuming it would have to be language-specific.

This is particularly interesting for contextualizing terse code, like Gocker shared here recently, which may have readability benefits in its brevity that is undone by use of obscure features and structure (like code golf).

Can anyone share existing discussion of this idea?

magixx 6 years ago

I believe cyclomatic complexity is related to what you're looking for. https://en.m.wikipedia.org/wiki/Cyclomatic_complexity There are tools/plug-ins available which try to measure this which could result in less complex and thus more readable code.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection