--- 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 second in C, but once I started using Perl and Java I
kept finding something happening that made it seem more consistent to
me to switch to the K&R style. I can't remember what it was for the
life of me, though. =o)
Regarding perlstyle, I personally find that K&R style reads better with
what Larry calls "cuddled elses" --
if ($foo) {
code();
} else {
otherStuff();
}
Now it's just habit, and I try to be consistent. =o)
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/