On Mon, 5 May 2008, Glynn Clements wrote:
FWIW I prefer to put { on the same line as the if/for/while as it tightens up the code vertically. But that is just my personal preference.Right; I tend to prefer quite a lot of whitespace, probably more than most people.
It seems only right to mention here that I also much prefer the opening brace of a conditional block on a line by itself ;) As well as IMHO making the code look less cluttered and neater, I find the extra space also helps me to see quickly at a glance where the start and end of a conditional block are.
As far as -cs, -saf, -sai, -saw for space after if,for,while etc. I prefer not to have that, to me those statements are like f(x), ie one is an argument for the other not a separate idea. In a similar way to how "G_some_fn ();" looks bad; just because if/for/while happen to be inbuilt fns doesn't matter.If/for/while/etc aren't functions; that's one of the main reasons I prefer a space in that case, to distinguish them from function calls. E.g. searching for "\>(" (end-of-word marker immediately followed by left parenthesis) finds function calls without also catching the test expression of an if/while/for/switch statement.
That's a nice idea - I thought it looked fine (space after if/for/while), but hadn't thought through the reasoning.
Paul _______________________________________________ grass-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/grass-dev
