Bluehost.com Web Hosting $6.95

RE: Fw: [PHP] debuging and getting mor information about failures

This is a discussion on RE: Fw: [PHP] debuging and getting mor information about failures within the PHP General forums, part of the PHP Programming Forums category; > -----Original Message----- > From: Chris W. Parker [mailto:cparker@swatgear.com] > Sent: 29 July 2003 19:22 > ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-30-2003
Mike Ford
 
Posts: n/a
Default RE: Fw: [PHP] debuging and getting mor information about failures

> -----Original Message-----
> From: Chris W. Parker [mailto:cparker@swatgear.com]
> Sent: 29 July 2003 19:22
> To: Ford, Mike [LSS]; Gabriel Guzman; Peter James
> Cc: php-general@lists.php.net
> 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: m.ford@lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 12:04 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0