In WordPress,
The WP core, many WP plugins, and the WP coding standards themselves use a very “generous application” of the Space character (not for indentation, but “inside” of parens and brackets). This seems to be unique to WordPress – this style/philosophy does not seem to be present in other similar projects, PHP or otherwise.
For more information on this approach, see:
Example: foreach ( (array) $foo as $bar ) { ...
I’m referring to the space after foreach, after the first (, and before the final ) (and other similar spaces shown in “Space Usage” at the link above).
This style seems unnecessary to me – it requires more typing and (opinion)makes parsing code visually more difficult.(/opinion)
My desire is not to debate whether or not this style is a good idea. Rather, I simply want to understand the motives for why this is the recommended style. Even commenters on the WP coding standards are curious: