Simetrical schreef:
On Tue, Apr 15, 2008 at 11:16 AM, Roan Kattouw roan.kattouw@home.nl wrote:
Hmm, it appears brace style is (inadvertently) very well-observed in the API, even though I generally put the opening brace on a separate line: $ grep '^\s*{' *.php | wc -l 1 $ grep '^.*[^\s].*{' *.php | wc -l 1549
You're missing subdirectories.
$ find includes/api -iregex '^.*.(php|inc)$' -exec grep '^\s*{' {} + | wc -l 111 $ find includes/api -iregex '^.*.(php|inc)$' -exec grep '^.*[^\s].*{' {} + | wc -l 1549
There aren't any in includes/api, except .svn, which shouldn't be counted.
Do you really feel it's necessary to use a different brace style than all of core code? The API is a part of the core software here. Not to mention variable naming conventions, etc., etc. Not that it really matters, but . . .
I don't. It's just that there are multiple acceptable variations on the general coding style (I believe the CODING-STYLE file explicitly says that it's OK to use a slightly deviating style, as long as you don't do very weird things) which are used in the core as well as in the API; it's just that the distribution of these styles in the API is very different from the distribution in the rest of the core.
Basically, this is about small differences like if (foo) vs. if(foo) vs. if( foo ) vs. if ( foo ), function foo()\n{ vs. function foo () {, and (something we didn't run regexes on) func('foo','bar') vs. func( 'foo', 'bar' ).
Roan Kattouw (Catrope)