Re: [dev] [sbase] style

From: FRIGN <dev_AT_frign.de>
Date: Mon, 17 Nov 2014 23:18:36 +0100

On Mon, 17 Nov 2014 14:10:49 -0800
Bobby Powers <bobbypowers_AT_gmail.com> wrote:

> By default I read if (!functioncall()) as 'if the function call
> failed'. I like the (strcmp(p, q) == 0) idiom because I don't fall
> into the trap of reading the statement as 'if the string comparison
> failed'. It is the one case I can think of where I prefer an explicit
> comparison to zero.

De gustibus non est disputandum.

However, given strcmp is such a special case, I was used to the == 0
idiom as well.
However, the more I used the ! the easier it was to read it.

Cheers

FRIGN

-- 
FRIGN <dev_AT_frign.de>
Received on Mon Nov 17 2014 - 23:18:36 CET

This archive was generated by hypermail 2.3.0 : Mon Nov 17 2014 - 23:24:07 CET