Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mimsy!eneevax!umd5!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: impossible problem for find(1)? Message-ID: <5817@brl-smoke.ARPA> Date: Thu, 30-Apr-87 15:27:52 EDT Article-I.D.: brl-smok.5817 Posted: Thu Apr 30 15:27:52 1987 Date-Received: Sat, 2-May-87 11:13:01 EDT References: <2645@phri.UUCP> <6454@mimsy.UUCP> <5797@brl-smoke.ARPA> <465@haddock.UUCP> <27409@rochester.ARPA> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 14 In article <27409@rochester.ARPA> ken@rochester.UUCP (Ken Yap) writes: >| EXIT( file1.st_mtime < file2.st_mtime ? 1 : 0 ); >Or better still: > EXIT( file1.st_mtime < file2.st_mtime); No, there are two major reasons for writing the first form: (1) The "newer" utility returns a variety of integer codes. By making the 1 and 0 values explicit (as well as the 2 value earlier), it is easier to see precisely what is returned. (2) I try to uniformly handle Boolean expressions as Booleans, not as integers. I find this practice leads to more reliable code in the long run. A minor reason is that any reasonable optimizer will generate the same code in either case, not that efficiency is important here.