G
Gary Morris
Agreed, and duly noted 
I just cannot stand to try and read code like that. Again,
period.

I just cannot stand to try and read code like that. Again,
period.
Anyway, one day I was interested in submitting code to a particular
open-source project. K&R bracing style was used throughout the project.
I decided that my dislike for the style wouldn't get in the way of my
desire to add to the project, so I grinned and beared it.
Jon Skeet said:Well, one of the reasons I believe K&R became popular was because it
was used in books - and in books, vertical space *is* a relatively
precious commodity. People copy what's written in books, and thus a
tradition is born...
if (x==y)
{
ThisFunc();
thatFunc();
OtherFunc();
}
if (x==y)
{ ThisFunc();
thatFunc();
OtherFunc();
}
2)
if (x==y) {
ThisFunc();
thatFunc();
OtherFunc();
}
James said:The problem with the "save a line" argument is that it just don't hold
up.
Given the code:
if (x==y) {
ThisFunc();
thatFunc();
OtherFunc();
}
it could still be written as:
if (x==y)
{ ThisFunc();
thatFunc();
OtherFunc();
}
In exactly the same number of lines, and you still get the advantage of the
braces line up.
number
Gary Morris said:Agreed, and duly noted
I just cannot stand to try and read code like that. Again,
period.
[top-posting fixed]number
Gary Morris said:Agreed, and duly noted
I just cannot stand to try and read code like that. Again,
period.
Then you can imagine how the rest of us feel about your top-posting!
Roy said:The later wastes space - one line with ONE character on it!
Hilton said:Are you referring to the "{" or the "}"? If you want to at least be
consistent, you should propose:
if (something) {
DoStuff ();
Do MoreStuff(); }
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.