Subject: Re: /etc/login.conf required to exist after user(8) changes
To: Hubert Feyrer <hubert@feyrer.de>
From: Rhialto <rhialto@falu.nl>
List: current-users
Date: 08/09/2005 11:41:41
On Fri 29 Jul 2005 at 12:44:32 +0200, Hubert Feyrer wrote:
> I see. Would it be possible to rewrite
> 
> +       ret = lc != NULL;
> 
> as something like
> 	ret = (lc == NULL)?1:0;
> 
> ? It's more readable IMHO.

When was grading student exercises (admittedly a long time ago) every so
often somebody would write (in Algol 68)

    IF something
    THEN FALSE
    ELSE TRUE
    FI

or even worse

    IF something
    THEN TRUE
    ELSE FALSE
    FI

Invariably they got points subtracted.

I would simply prefer 

    ret = lc;

except that in C there is no coercion to bool since there is no true
bool type, so one is left with the original "ret = lc != NULL", or
perhaps "ret = !!lc;" which is hopefully optimised by the compiler to
the same.

(besides: your expression is the negation of the original one)

>  - Hubert
-Olaf.
-- 
___ Olaf 'Rhialto' Seibert      -- You author it, and I'll reader it.
\X/ rhialto/at/xs4all.nl        -- Cetero censeo "authored" delendum esse.