allow line break at operators
Seebs
usenet-nospam at seebs.net
Mon Aug 15 12:32:07 EDT 2011
On 2011-08-15, Roy Smith <roy at panix.com> wrote:
> Demand, no, but sometimes it's a good idea. I've been writing computer
> programs for close to 40 years, and I still have no clue what most of
> the order of operations is. It's just not worth investing the brain
> cells to remember such trivia (especially since the details change from
> language to language). Beyond remembering the (apparently) universal
> rule that {*, /} bind tighter than {+, -}, I pretty much just punt on
> everything else and put in extra parens everywhere.
>
> It's not the most efficient way to write code, and probably doesn't even
> result in the prettiest code. But it sure does eliminate those
> face-palm moments at the end of a long debugging session when you
> realize that somebody got it wrong.
Wholehearted agreement. It is conceivable for me to misremember precedence.
I am pretty reliable at recognizing which things are in which parens.
So I use them even in obvious cases:
foo + (3 * 4)
Never regretted that. Yes, it's extra typing, a little, but it prevents a
whole category of bugs.
-s
--
Copyright 2011, all wrongs reversed. Peter Seebach / usenet-nospam at seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
I am not speaking for my employer, although they do rent some of my opinions.
More information about the Python-list
mailing list