Python is readable
Mon Mar 19 12:34:58 CET 2012
On 3/18/2012 2:36, Steven D'Aprano wrote:
> On Sat, 17 Mar 2012 20:59:34 +0100, Kiuhnm wrote:
>> Ok, so length and readability are orthogonal properties. Could you
>> please explain to me in which way
>> mov eax, 3
>> should be less readable than
>> for i in x: print(i)
> "mov eax, 3" requires more domain-specific knowledge. It operates at a
> very low level, that of memory locations and bytes, rather than at a
> level which most people can reason about efficiently.
> English speakers would probably guess that "mov" was an abbreviation of
> "move", but what is being moved, and from where to where, for what
> They're also likely to flounder on the analogy of "moving" bytes. When
> you move a book from here to there, you leave a space in the row of books
> where there is no longer a book. (You might choose to move a second book
> into that gap, but first there is a gap.) But when you move bytes, you
> don't leave a gap. There are always bytes at every valid address. The
> average non-programmer is likely to have the wrong data model to
> understand what "mov eax, 3" does.
> In the second example, most English speakers would intuit that "print(i)"
> prints i, whatever i is. "for i in x" is more cryptic, but if it were
> written with less jargon-like names, such as "for item in list" or "for
> person in family" or similar, they would likely guess that it means to
> repeat the following instructions for each item in the set:
> "For each person at the table, place a plate, knife and fork."
> And even if the reader can't guess the meaning of the for-loop, it is a
> concept easy enough for most people to grasp given some explanations and
> examples. It's neither too low level (assembly language), nor too high
> level (monads, functors) but is at just the right level of abstraction
> versus concreteness for the average person to follow.
Would you be so kind to give me your final definition of readability and
/stick/ to it?
You keep changing it every time I point out a flaw in it.
More information about the Python-list