I do it this way.
for (;
{
}
and:
if () {
}
else {
}
(same for methods, i.e. not KNR style (mostly because VS.NET doesn't support it))
If I have one statement in the block then I use no blank lines, e.g.
for (;
{
this.DoSomething();
}
If I have more than one, then I use blank lines too, e.g.
for (;
{
this.DoSomething();
this.DoSomethingElse();
}
I always close curly braces without a blank line. I have a heap of other rules too.. ![]()
I use 'two spaces' instead of tabs for indenting (religiously).
Example:
public void SomeMethod(Int32 someParam) {
if (someParam < 10) {
return;
}
for (Int32 i = 0; i < someParam; i++) {
this.DoSomething();
this.DoSomethingElse();
}
}
My way is of course the best, and all other ways suck!
John.
Discussions
Check me out on the web at www.jj5.net.
-
-
lars wrote:save the whole thing as XML instead of a text file?
Oh dear..