Mail Archives: djgpp/2000/04/07/12:52:21
Andrew Hakman wrote:
> int main(void)
> {
> printf("Hello, World!");
> return 0;
> }
>
> you can tell where functions, loops, etc. end and eliminates the need for
>
> } //end of whatever - this comment I see in other people's code all
> the time because there final closing bracket doesn't line up with their
> function, and they can't figure out what it is closing otherwise.
If your function is more than a page, you can't see what it is 'lined up' with
anyways. I think that flow-of-code is more important than lining up braces,
but this might be because I use XEmacs which automatically shows me the
matching brace. (They are not brackets. "[ ]" are brackets, "( )" are
parentheses - also called parens, and "{ }" are braces).
I personally code as follows:
int main() {
printf("Hello world");
return 0;
}
or
int class::method()
: member(value)
{
body();
}
--
(\/) Rolf Campbell (\/)
- Raw text -