[SystemSafety] A small taste of what we're up against
Derek M Jones
derek at knosof.co.uk
Thu Oct 25 18:57:25 CEST 2018
Peter,
> So the other part of the story is having a "easy-to-read" program
> structure and coding style
"easy-to-read", or readability as it's known in academic work,
is one of those terms that is easy to get general agreement on,
but extremely hard to specify.
Domain knowledge is an important factor. Knowing what the code
is trying to do is a big help in following it.
Language fluency is also a big help. Recognizing the idioms
used by writers of a particular language removes the need to
have to think much about chunks of the code.
Variable names are also important. If you disagree, try reading
code containing variable names designed for speakers of other native
languages, e.g., French and German.
What does that leave? Certainly a lot less, but I don't know
how much less.
There have been a handful of experiments investigating readability.
Students or Mechanical turk workers were asked to judge the readability
of code. There were a couple of small effects and lots of random
noise.
My own view is that people find code easy to read if it follows the
conventions of the kind of code they spend lots of time reading.
That is, it's all down to practice effects. People find it
easy doing the stuff they always do.
When people argue over technical details, they are really arguing
their own preferences based on the code they have spent a lot of
time reading.
--
Derek M. Jones Software analysis
tel: +44 (0)1252 520667 blog:shape-of-code.coding-guidelines.com
More information about the systemsafety
mailing list