views:

43

answers:

2

Hi,
I really like the "blanking after open and before close brackets"-codingstyle in modern codes Java/C#/C++ .
e.g. calling a function:

foo(myparam);
// versus
foo( myparam );

Do you have a better name for this codingstyle? where does it come from? Do you like it either, what is the reason for you to use it or not use it? a few years ago people said "you are blanking" if one has used too much blank space characters in a forumspost or email. many thanks in advance
regards
Oops edit: two cons, any pros out there?

+3  A: 

I think it's just common sense. From the style guide for Delphi:

Object Pascal

Parenthesis

There shall never be white space between an open parenthesis and the next
character. Likewise, there shall never be white space between a closed
parenthesis and the previous character. The following example illustrate
s incorrect and correct spacing with regard to parentheses:

  CallProc( AParameter ); // incorrect
  CallProc(AParameter);   // correct

And from Pythons' PEP8, under "pet peeves":

Avoid extraneous whitespace in the following situations:

- Immediately inside parentheses, brackets or braces.

  Yes: spam(ham[1], {eggs: 2})
  No:  spam( ham[ 1 ], { eggs: 2 } )

And so on. I've never seen a style guide that recommended space padding there.

Marco Mariani
+1  A: 

I personally call that convention padding. I do not use it, I prefer the foo(arg) convention better.

Anthony Forloney