[Mono-list] Style

Nick Drochak nick@jobdragon.com
Fri, 1 Mar 2002 16:50:47 +0900


Miguel,

Thanks for updating the style guide. It's nice to know what the preferred
style is.

You have this about braces:
	good:
		if (a)
			code ();

	bad:
		if (a) {
			code ();
		}

I would like to suggest that the "bad" way you have here is not bad at all.
I find the "good" way you have there to be more bug prone because when
someone later adds code do be executed when the if is true. They may write
it like:

	if (a)
		doThis ();
		andDoThis ();

	thenThis ();

This code is buggy, but not obviously. If the braces were there to begin
with, then it is much more likely they will write it correctly as:

	if (a) {
		doThis ();
		andDoThis ();
	}

	thenThis ();


My 2 pesos,
Nick D.