Re: Which is better coding style...

From: Date: Thu, 19 Apr 2001 21:53:48 +0000
Subject: Re: Which is better coding style...
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-49436@lists.php.net to get a copy of this message
On 19 Apr 2001 14:08:13 -0700, ..s.c.o.t.t.. [gts] <scott@graphictype.com> wrote: >OOooo... > >it drives me nuts when i see beginning brackets >on seperate lines ;) > >i like to start brackets on the same line as the >statement and finish them on a line of their own. Very strong agreement here. I think a lot of it depends on your environment. Some have syntax highlighting and, better yet, syntax highlighting which will prominently mark unbalanced braces, brackets, etc. Also very nice are things like a brace-matching hotkey or options to highlight the matching open character when you close it. If you have all of these tools to help show syntax, I don't think you need as help from the source formatting. (The only times I've liked having them on separate lines is when I've been working with an editor which lacks this) It also helps to properly indent things. I think code like this makes it pretty easy to see which code is in which block: if () { ... if () { if () { // Do something } else { // Do something else } } } else { ... } This is one thing I've always liked about Python. Forcing people to indent consistently is a little harsh but it does have the advantage of making strange code easier to decipher. >(it drives me nuts to see "} else {" also) Here, I have to differ - using anything else makes me itch. -- "Any sufficiently accurate worldview is indistinguishable from cynicism"

« previous php.general (#49436) next »