Abandon NULL for (0)

Steve Mawer scm at datlog.co.uk
Tue Oct 3 22:19:35 AEST 1989


In article <1005 at kim.misemi> kim at kim.misemi (Kim Letkeman) writes:
> [stuff about using "(0)" instead of "NULL" making programs harder to
> read and maintain]
>                                               I also did not like the
>original author's tendency to write the NULL first in a comparison
>(e.g. if (NULL == some_ptr)) because this obscures the fact that the
>pointer is the object of interest. The value for which you are
>comparing is secondary (although important.)

I also find this comparison ordering unpleasant, but (silver lining!) 
it is a convenient way of finding those irritating moments when you've
mistyped "==" as "=".

-- 
Steve C. Mawer        <scm at datlog.co.uk> or < {backbone}!ukc!datlog!scm >
                       Voice:  +44 1 863 0383 (x2153)



More information about the Comp.lang.c mailing list