Re: How to write code: how wrong am I?

From: Date: Tue, 22 Feb 2011 14:15:19 +0000
Subject: Re: How to write code: how wrong am I?
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-311523@lists.php.net to get a copy of this message
On 11-02-22 09:06 AM, Dotan Cohen wrote:
On Tue, Feb 22, 2011 at 14:58, Robert Cummings<robert@interjinn.com> wrote:
I'm more likely to do this stuff for HTML than PHP. However, I do sometimes lay out the structure of some conditionals/functions before fleshing them out so that I can do some early testing... but I always fill the conditional as I'm doing this. In case that's not clear... the code flows from first character to last character as I type all of the conditionals (no jumping around). Later I fill in the associated activity for the conditional.
Thanks for the insight. I could see where that is a good compromise. Like this I suppose: if (something) ---- if (something) { } ---- if (something) {
     // Code here
}
If you switch to vertically aligned braces you will have an easier time matching up open and close braces... if (something) {
    // Code here
} It's trivial to match using this style since you only need to scan one axis. Cheers, Rob. -- E-Mail Disclaimer: Information contained in this message and any attached documents is considered confidential and legally protected. This message is intended solely for the addressee(s). Disclosure, copying, and distribution are prohibited unless authorized.

« previous php.general (#311523) next »