RE: Fw: [PHP] debuging and getting mor information about failures
| From: | Chris W. Parker | Date: | Tue, 29 Jul 2003 18:22:21 +0000 |
| Subject: | RE: Fw: [PHP] debuging and getting mor information about failures | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-157369@lists.php.net to get a copy of this message | ||
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 and
generates no useful benefit. And besides, it reminds me of my days of
VBScript. blagh.
I also think there may be something to say about how often a person
checks their updates. I usually don't write more than a few lines of
code before I try it out in the browser. Checking the code frequently
makes it a trivial task to find syntax errors, especially since you know
the error has to be contained within the tiny block of code you were
just writing.
Chris.