Steve Holden wrote: [was Python-list digest, Vol 1 #10572 - 14 msgs]
Roman Neuhauser
neuhauser at mail.cz
Sat Apr 27 14:07:27 EDT 2002
> From: Michael Gilfix <mgilfix at eecs.tufts.edu>
> To: python-list at python.org
> Subject: Re: Steve Holden wrote: [was Python-list digest, Vol 1 #10572 - 14 msgs]
> Date: Sat, 27 Apr 2002 13:09:42 -0400
> On Sat, Apr 27 @ 19:10, Roman Neuhauser wrote:
> > Anyone who writes "if (x == 0)" instead of "if (0 == x)" deserves
> > what he begs for.
>
> I disagree entirely. When writing production code, you want to model
> the thought process that goes into creating the code as clearly if
> possible. If in your head you're thinking "if 'x' is equal to 0",
> then you probably want to write it that way. While writing 0==x is
> a better move in C, it's entirely against intuition and the natural
> thought process.
I disagree entirely.
When I write code @work, I think "if 'x' is equal to 0", because
one of my colleagues couldn't wrap his head around the safe way.
When I write my own code, I think "if 0 is equal to 'x'". No, wait,
I don't know what I think: the thought is abstract, and can be
written both ways. But I actually have to remember to put the
variable on the left, and the constant on the right side.
> Python is smart to avoid such assignments...
Python thinks I'm too dumb to take care of myself.
--
FreeBSD 4.4-STABLE
8:02PM up 12 days, 9:14, 10 users, load averages: 0.06, 0.04, 0.01
More information about the Python-list
mailing list