Re: A defense for bracket-less code

2006-04-26 Thread Carl Banks
Edward Elliott wrote: > Stelios Xanthakis wrote: > > Also, I think that perl does that because otherwise code like > > > > if ($x) $y++ if $z; else $z--; > > > > would be even more confusing :) > > With or without braces, that's not legal code. A one-line if can't be > followed by an else. Thus p

Re: A defense for bracket-less code

2006-04-26 Thread Edward Elliott
Stelios Xanthakis wrote: > Also, I think that perl does that because otherwise code like > > if ($x) $y++ if $z; else $z--; > > would be even more confusing :) With or without braces, that's not legal code. A one-line if can't be followed by an else. The closest you can do is this: $y++ if $z

Re: A defense for bracket-less code

2006-04-26 Thread Stelios Xanthakis
Edward Elliott wrote: > Dave Hansen wrote: > >>Not really. It was mostly a lead-in to that last sentence. Problems >>like this couldn't happen in Python. So it's an opportunity to get a >>giggle at the expense of programmers using a language that gives you >>enough rope to shoot yourself in th

Re: A defense for bracket-less code

2006-04-26 Thread Edward Elliott
Dave Hansen wrote: > Not really. It was mostly a lead-in to that last sentence. Problems > like this couldn't happen in Python. So it's an opportunity to get a > giggle at the expense of programmers using a language that gives you > enough rope to shoot yourself in the foot... Which can be enti

Re: A defense for bracket-less code

2006-04-26 Thread Dave Hansen
On Wed, 26 Apr 2006 10:20:57 -0400 in comp.lang.python, Don Taylor <[EMAIL PROTECTED]> wrote: >Found in a style guide (http://www.artlogic.com/careers/styleguide.html) >--- >Another case where "unnecessary" braces should be used i

Re: A defense for bracket-less code

2006-04-26 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > wrong group why? -- http://mail.python.org/mailman/listinfo/python-list

Re: A defense for bracket-less code

2006-04-26 Thread [EMAIL PROTECTED]
wrong group -- http://mail.python.org/mailman/listinfo/python-list

A defense for bracket-less code

2006-04-26 Thread Don Taylor
Found in a style guide (http://www.artlogic.com/careers/styleguide.html) --- Another case where "unnecessary" braces should be used is when writing an empty while loop: while (*p++ = *q++) { // this loop intentionally left em