The coding guidelines we used to follow ( http://www.mantisbt.org/wiki/doku.php/mantisbt:coding_guidelines?rev=1366406915 ) state "if (" , so that was actually changed.

Looking at the timestamp of the change - 14th August 2013, I can't see a discussion / post on the gname.org mailing list archive about it changing. I noticed this as victor's recent code was using the original if ( format. It may be there was a discussion and it's not picked been picked up on my gname.org search of the archives, but equally, if the coding guidelines got changed without telling people then it's not surprising I'm still aware of the original guidelines.

In any case, I'll assume it's a case that we people prefer if( and victor needs to adapt to this :)

Paul


On Tue, Jun 3, 2014 at 9:04 AM, Damien Regad <dregad@mantisbt.org> wrote:
With regards to code blocks (if, for, while, etc), it's already clearly
stated in our coding guidelines [1]:

"No space before the opening parentheses ( in a condition, e.g. if( ...
not if ("

We don't have anything specific about array elements in the wiki, so the
reference guideline [2] should apply; although not clearly stated, the
given examples do not use spaces (which is also also my personal
preference).

Damien


[1] http://www.mantisbt.org/wiki/doku.php/mantisbt:coding_guidelines
[2]
http://www.sourceformat.com/coding-standard-php-kristiansen.htm#arrayelement


On 2014-06-03 00:08, P Richards wrote:
> Right, code police time….
>
> “If( “ occurs 2168 times in core api’s
>
> “if ( “ occurs 529 times in the core api’s
>
> “if(“ is used 220 times in /
>
> “if (“ is used 1292 times in /
>
> Victor: you seem to use “if (“ – which is what our historical code guide
> standards state (iirc, we differ from the php standards we loosely
> follow on this point
>
> Damien: you’ve done code tidyup’s recently fixing “if (“ to “if(“

>
> I think what’s actually happened here (and the reason I posted the split
> of where it’s used), is the original code has used “if (“ – and the
> newer developers/authors have used “if( “. (I know I have at least)
>
> Personally, I prefer if( as it’s more inline with what we do with other
> function calls e.g. if( config_get( $foo ) ) { … } means we treat the
> whitespace the same for any function call. Equally, I think I recall
> that the code guidelines state to use $foo[‘bar’] with no spaces for
> arrays – I’m pretty sure I’ve been guilty of adding spaces to arrays in
> the past, and I think I’d probably go with the code guidelines being
> correct in terms of not adding spaces, and me as being wrong in this
> case for readability.
>
> That said…, I don’t really care what is deemed to be correct as whatever
> we choose, at some point I’ll find a language/editor/project that does
> the opposite style, however can we pick ONE of the two!!! Equally, I’d
> suggest we’d tidy this up just before a 1.3 branch once we’ve not got
> outstanding patches to make everyone’s life a bit easier:
>
> So which of the following should be the correct version to use going
> forwards:
>
> a)If( config_get( $t_foo[ ‘bar’ ] ) ) { … }
>
> b)if( config_get( $t_foo[‘bar’] ) ) { … }
>
> c)If ( config_get( $t_foo[‘bar’] ) ) { … }
>
> d)If ( config_get( $t_foo[ ‘bar’ ] ) ) { … }
>
> C I believe represents our code standards, A seems to be what we’ve been
> using in more recent code.
>
> B/D I think i.e. space in [] I think occur few enough times in the code
> to represent a typo by the author
>
> Victor/Damien – pick one! J
>
> Paul
>
>
>
> ------------------------------------------------------------------------------
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and their
> applications. Written by three acclaimed leaders in the field,
> this first edition is now available. Download your free book today!
> http://p.sf.net/sfu/NeoTech
>
>
>
> _______________________________________________
> mantisbt-dev mailing list
> mantisbt-dev@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mantisbt-dev
>



------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
mantisbt-dev mailing list
mantisbt-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mantisbt-dev