Nuttdan wrote:
I'm very compulsive about my coding style. I always use braces, even for single line statements, and I always indent, and I prefer the braces on a new line. I also am compulsive about the way I write conditional statements, so I don't get the parenthesis in nested boolean logic confused. And with functions that take a lot of parameters, or really long SQL queries, I tend to break them up on multiple lines.
My coding style probably seems a mess and inconsistent to other people but it makes perfect sense to me.
To me an if-statement which has only one conditional statement would confuse me if it had brackets as I see it as a single command spread over multiple lines. Just like functions that take a lot of parameters, which it sounds like I format the same as you. I do not like lines wrapping so I do spread a lot of statements horizontally to avoid that.
For SQL I always put everything on separate lines, so "SELECT" would be one a line, followed by each column on its own line and tabbed, and so on. I usually have very long SQL statements!
Michael.