Philip Martin wrote:
> Karl Fogel <kfogel_at_red-bean.com> writes:
> 
>> Philip Martin <philip_at_codematters.co.uk> writes:
>>> blair_at_tigris.org writes:
>>>> Author: blair
>>>> Date: Wed Jun  4 08:01:31 2008
>>>> New Revision: 31583
>>>>
>>>> Log:
>>>> * subversion/libsvn_wc/entries.c:
>>>>   Style change.  Replace all
>>>>     if (! strcmp(a, b))
>>>>   with
>>>>     if (strcmp(a, b) == 0)
>>> I see this has got into hacking when I wasn't paying attention :-(
>> Heh.  Didn't know you minded; can you survive? :-)
> 
> If there is a consensus, yes.
> 
> To my eye strcmp() == 0 is as ugly as the construct 5 == x; I find
> !strcmp() is as natural as !ptr.  entries.c used both strcmp styles
> and ! form was dominant so at least one other developer must agree
> with me.  I realise styles change; years ago when I started writing C
> the people I worked with would only ever have written strcmp() == 0 if
> it was mixed with strcmp() > 0 or strcmp() < 0.  Writing strcmp() == 0
> on it's own it would probably have attracted comments referring to
> Pascal, or Modula2, and the subsequent debate would inevitably include
> "of course a real programmer would use FORTRAN".
I like using 5 == x even if its ugly since it prevents coding mistakes.
The other one strcmp() == 0 I don't think is ugly and I don't feel strongly 
about either style, but since it went into hacking.html, I don't have a problem 
using that style.
Blair
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-06-04 21:45:50 CEST