I work with two major styles of whitespace/parentheses at work, depending on the project I'm working. The two styles are:
Style 2:Code:int x = function( arg1, arg2 ); if( conditional ) doIt();
Take careful note of whitespace, on the left and right sides of the parentheses, and in the two different contexts -- function call, vs. syntactic expression.Code:int x = function(arg1, arg2); if (conditional) doIt();
In style 1, the inner contents are always set off from the parens by a single space, regardless of context. The parentheses nestle directly against the left and right exterior.
In style 2, the parens distinguish between function context and conditional context. In function context, they nest tightly on either side, but in conditional context, they nestle with a space on the exterior, but tightly on the interior.
It's an interesting combo to see within one company, but both styles have justifications. Opinions?