[Python-ideas] Objectively Quantifying Readability
Chris Angelico
rosuav at gmail.com
Mon Apr 30 20:56:05 EDT 2018
On Tue, May 1, 2018 at 10:42 AM, Steven D'Aprano <steve at pearwood.info> wrote:
> The conclusion here is that if you want readable source code, you should
> remove the source code. *wink*
That's more true than your winky implies. Which is more readable: a
Python function, or the disassembly of its corresponding byte-code?
Which is more readable: a "for item in items:" loop, or one that
iterates up to the length of the list and subscripts it each time? The
less code it takes to express the same concept, the easier it is to
read - and to debug.
So yes, if you want readable source code, you should have less source code.
ChrisA
More information about the Python-ideas
mailing list