Re:Making code better with code reviews
by raverbashing on Wednesday July 02, 2014 @10:24AM
(#7977129)
True, amongst the examples given they all score more or less the same to me (and it's a short example)
A lot on readability stands on the expectations of the reader (and the idioms of the language) as well. For a lisp programmer (* (hours 3600)) may be easier to read for example.
Now I can take that example and turn into
ttscds = x * (36 * 10 * 10);
And we know this is less readable, the intentions are hidden and nobody unfamiliar with the code knows what's going on.
One nice write-up on readability I saw is this: http://www.perlmonks.org/?node_id=592616 along with sources cited therein. It sums up the problems with defining readability nicely.
The bottom line is that we can't say for sure if this:
is any better than this: or this: or this: or this: or this: or... you get the idea.And we not only don't know which is better in general, but even which would be better in most specific conditions. We just don't know. Saying otherwise is just an expression of opinion or personal preference. I think acknowledging this would be a decent first step towards improving the readability level of code in general.