News for hackers. Stuff that matters.
Re:What If I Don't Actually Like My Users? (2008) by rdtsc on Friday June 03, 2016 @01:41AM (#11828567)
Well to each its own, or however the saying goes. Because strcmp() returns a difference, as you said, i.e. a number comparing it a number "== 0" makes most sense to me.

> "not" means "no difference

I'd rather see less "not"s, it is easier to reason about. "not" means logical expressions to me, strcmp returns numbers, I would rather keep ! away.

> "if(!p)" means "there is no (object pointed to by) p".

Ok, now we have pointer in play. strcmp really does return numbers. Why bring pointers or logic operators, doesn't that confuse things? It does for me.

> ((strcmp(a, b) == 0) != false)

I have never seen that. And would never advocate for that, why are we doing it that way again?

Re:What If I Don't Actually Like My Users? (2008) by lfowles on Friday June 03, 2016 @12:34PM (#11831329)
>> ((strcmp(a, b) == 0) != false)

>I have never seen that. And would never advocate for that, why are we doing it that way again?

I think a more reasonable example would be (with some reasonably namespaced define, blah blah blah):

    strcmp(a, b) == CMP_EQUAL;