Mail Archives: djgpp/2000/04/07/15:38:21
On Thu, 06 Apr 2000 02:55:05 GMT, Andrew Hakman <hakmana AT hotmail DOT com>
wrote:
>I would have to agree with this. Since I started programming in c++ (in
>DJGPP right from the start!) 2 years ago, I was introduced to both
>bracketing styles, and liked the "lined up bracket" style right off the bat,
>only I usually do mine like this:
>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. Another
>thing I hate (hope I'm not stepping on too many toes here) is using TABs for
>indents. For quite compact, yet very readable code I tend to use 2 spaces
>for indents.
>
>Guess it really comes down to personal preference!
>Andrew
I do the same thing (most of the time), although I have written some
files in GNU style (braces two spaces in, code two spaces inside
braces) because that's what Emacs automatically does. (This lets
people see what editor I was using when I wrote a file:
// if it's Edit.com:
for(i = 0; i < 10; i++)
{
foo(i);
bar(i);
}
// if it's GNU Emacs:
for(i = 0; i < 10; i++)
{
foo(i);
bar(i);
}
>> int main(void) {
>> printf("Hello, World!");
>> return 0;
>> }
>>
>> (...or some variation thereof).
That's "1tbs" or one true brace style, used in examples in K&R.
--
Damian Yerrick
"I refuse to listen to those who refuse to listen to reason."
See the whole sig: http://www.rose-hulman.edu/~yerricde/sig.html
This is McAfee VirusScan. Add these two lines to your signature to
prevent the spread of signature viruses. http://www.mcafee.com/
- Raw text -