Coding style updates

Gerald (Jerry) Carter jerry at samba.org
Sun Oct 21 13:13:00 GMT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Michael Adam wrote:

>> -If the beginning statement has to be broken across lines due to length,
>> -the beginning brace should be on a line of its own.
> 
> I don't agree upon removing this rule. 
> 
> To my taste this is good:
> 
>> 	for (very_long_var_name_x=1;
>> 	     very_long_var_name_x<10;
>> 	     very_long_var_name_x++)
>> 	{
>> 		print("%d\n", very_long_var_name_x);
>>  	}
> 
> and this is really bad:
> 
>> 	for (very_long_var_name_x=1;
>> 	     very_long_var_name_x<10;
>> 	     very_long_var_name_x++) {
>>  		print("%d\n", very_long_var_name_x);
>>  	}
> 
> In this case, putting the opening brace into a line of its own
> (and unindented) *greatly* enhances readability. In the second
> example, it is hard to see at the first glance where the body of
> the loop begins.

+1 no Michael's comments.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.4 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHG1BcIR7qMdg1EfYRAiuFAJ0SvsMWXfVq2u1MWFMJxrdsH3D9GACeOdiN
rMRkwP5zx/nhqzHZokYfanI=
=WBHO
-----END PGP SIGNATURE-----


More information about the samba-technical mailing list