News for hackers. Stuff that matters.
Re:Understandability in software by waheoo on Tuesday June 09, 2020 @08:17PM (#23472509)
Code complexity is a thing. It doesnt describe understandability but its a pretty decent proxy in my experience.

> In 1976, Thomas McCabe Snr proposed a metric for calculating code complexity, called Cyclomatic Complexity.

https://blog.codacy.com/an-in-depth-explanation-of-code-comp...

There is also likely some simple metrics you could get by looking at names of things alone.

Common substrings, length, and diversity of names are probably decent indicators.

Re:Understandability in software by flukus on Tuesday June 09, 2020 @09:36PM (#23472936)
Understandability here is more of an umbrella term for the system as a whole, cyclomatic complexity is generally only useful for much more isolated chunks of code. Reducing CC can also make the the system as a whole less understandable, moving an inner loop into it's own function for a simple example will reduce the cyclomatic complexity of the outer function yet the complexity hasn't really changed and now there is more indirection for the developer to deal with. It's a good tool for telling you how complicated a piece of code is, but generally there aren't many options to reduce it other than hacking the metric and making the system as a whole more complicated and less understandable.
Re:Understandability in software by waheoo on Tuesday June 09, 2020 @10:40PM (#23473338)
I wonder if there is any comprehension metrics we could use in its place, similar how you can measure reading comprehension levels of certain text?