> -----Original Message-----
> From: Chris W. Parker [mailto:[EMAIL PROTECTED]
> Sent: 29 July 2003 19:22
> To: Ford, Mike [LSS]; Gabriel Guzman; Peter James
> Cc: [EMAIL PROTECTED]
> Subject: RE: Fw: [PHP] debuging and getting mor information about
> failures
> 
> 
> Ford, Mike <LSS>
>     on Tuesday, July 29, 2003 11:00 AM said:
> 
> > I know the braces vs. end-token debate is almost on the scale of a
> > holy war, and I admit to hating the curly-brace style with 
> a passion,
> > but when I see code like this:  
> > 
> > function doit()
> > {
> >     for()
> >     {
> >             if()
> >             }
> >                     ...
> >             }
> >             else
> >             {
> >                     ...
> >             } // if
> >     } // for
> > }
> > 
> > I wonder why the heck the author didn't just go for the alternative
> > syntax with proper end-tokens and get the added value they deliver.
> 
> You are correct. If I had in fact originally written my block of code
> with "// if" and "// for" it would make more sense to use the
> alternative syntax that you detailed in your original mail. But I
> /didn't/ use "// if" and "// for" therefore I wouldn't use the
> alternative syntax because it's just more characters to type

All true so far, and I wouldn't argue with any of this if that is your preference.

>  and
> generates no useful benefit.

But this I would take issue with -- as I said in my original email, you tend to get 
more-focussed error messages if you accidentally omit one of the end-tags than if you 
omit a closing brace.  It's also more obvious exactly *which* end-tag you've left out. 
 (Although I did once spend half a day completely failing to spot a missing "endif" 
right where the error message was pointing, and chasing all sorts of other red 
herrings before seeing the error and turning the local air blue in disbelief!!!).

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to