Re: Perl Style Question

2001-06-26 Thread Jeff Yoak
At 06:05 PM 6/26/01 -0400, Gross, Stephan wrote: >Why is this style > >if ($x) { > do this; > do that; >} > >typically preferred over > >if ($x) >{ >do this; >do that; >} > This tends to be a hotly debated religious issue. There are people who use that later abomination. ;-) T

Re: Perl Style Question

2001-06-26 Thread Brett W. McCoy
On Tue, 26 Jun 2001, Gross, Stephan wrote: > Why is this style > > if ($x) { > do this; > do that; > } > > typically preferred over > > if ($x) > { >do this; >do that; > } > > I like the latter example because it's easier to cut and paste the braces > and everything in between. I

Re: Perl Style Question

2001-06-26 Thread Paul
--- iain truskett <[EMAIL PROTECTED]> wrote: > I use cuddled if what I'm doing would look silly otherwise. e.g. > > if ($blah) { > one line; > } elsif ($flurp) { > one line; > } else { > one line; > } Hey! I think that was the thing that made me switch! =o) In C I could say if

Re: Perl Style Question

2001-06-26 Thread iain truskett
* Paul ([EMAIL PROTECTED]) [27 Jun 2001 00:50]: > --- iain truskett <[EMAIL PROTECTED]> wrote: > > * Gross, Stephan ([EMAIL PROTECTED]) [26 Jun 2001 22:16]: [...] > I always used the second in C, but once I started using Perl and Java > I kept finding something happening that made it seem more con

Re: Perl Style Question

2001-06-26 Thread Paul
--- iain truskett <[EMAIL PROTECTED]> wrote: > * Gross, Stephan ([EMAIL PROTECTED]) [26 Jun 2001 22:16]: > > Why is this style > > > if ($x) { > > do this; > > do that; > > } > > > typically preferred over > > > if ($x) > > { > >do this; > >do that; > > } I always used the sec

Re: Perl Style Question

2001-06-26 Thread Peter Scott
At 06:05 PM 6/26/01 -0400, Gross, Stephan wrote: >Why is this style > >if ($x) { > do this; > do that; >} > >typically preferred over > >if ($x) >{ >do this; >do that; >} > >I like the latter example because it's easier to cut and paste the braces >and everything in between. I als

Re: Perl Style Question

2001-06-26 Thread Adam Turoff
On Tue, Jun 26, 2001 at 06:05:15PM -0400, Gross, Stephan wrote: > Why is this style > > if ($x) { > do this; > do that; > } This style is also known as The One True Brace Style, popularized by Kernighan & Ritchie (in _The C Programming Language_). It's also popular with other languages

Re: Perl Style Question

2001-06-26 Thread iain truskett
* Gross, Stephan ([EMAIL PROTECTED]) [26 Jun 2001 22:16]: > Why is this style > if ($x) { > do this; > do that; > } > typically preferred over > if ($x) > { >do this; >do that; > } > I like the latter example because it's easier to cut and paste the > braces and everything in b

Re: Perl Style Question

2001-06-26 Thread Paul Johnson
On Tue, Jun 26, 2001 at 06:05:15PM -0400, Gross, Stephan wrote: > Why is this style > > if ($x) { > do this; > do that; > } > > typically preferred over > > if ($x) > { >do this; >do that; > } > > I like the latter example because it's easier to cut and paste the braces > a

Perl Style Question

2001-06-26 Thread Gross, Stephan
Why is this style if ($x) { do this; do that; } typically preferred over if ($x) { do this; do that; } I like the latter example because it's easier to cut and paste the braces and everything in between. I also think it looks better. But none of the top programmers ever see