On Tue, Feb 22, 2011 at 15:00, Andy McKenzie <[email protected]> wrote:
> I'll be the first to tell you that I'm not a great programmer, so my
> take may not be worth a lot. However, this is pretty close to how I
> write. Not exactly, but close. I also always label open and closing
> brackets on everything, unless the brackets are less than three lines
> apart. For instance, I might find myself writing:
>
> if($foo == 'bar')
> { # Begin foo=bar test
> # If foo=bar, do a lot of things.
>
> } # End foo=bar test
>
> Then I go back and fill in the conditional stuff.
I also do something similar, I debated writing about that as well:
class someClass{
function someFunction() {
if (true) {
// Some Code
}
} // end someFunction
} // end someClass
I don't strictly subscribe to a three-line limit, but whatever feels
reasonable at the time. Often that depends on the complexity of
surrounding code.
--
Dotan Cohen
http://gibberish.co.il
http://what-is-what.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php