is there any principle when writing python function

Ben Finney ben+python at benfinney.id.au
Sat Aug 27 17:57:48 EDT 2011


Emile van Sebille <emile at fenx.com> writes:

> Code is first and foremost written to be executed.

−1 QotW. I disagree, and have a counter-aphorism:

    “Programs must be written for people to read, and only incidentally for
    machines to execute.”
    —Abelson & Sussman, _Structure and Interpretation of Computer Programs_

Yes, the primary *function* of the code you write is for it to
eventually execute. But the primary *audience* of the text you type into
your buffer is not the computer, but the humans who will read it. That's
what must be foremost in your mind while writing that text.

-- 
 \      “If you can't beat them, arrange to have them beaten.” —George |
  `\                                                            Carlin |
_o__)                                                                  |
Ben Finney



More information about the Python-list mailing list