Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!adm!ultra!wayne@ames.arpa From: wayne@ames.arpa Newsgroups: comp.lang.c Subject: Pet peeve #1473 Message-ID: <9001@brl-adm.ARPA> Date: Tue, 25-Aug-87 19:57:24 EDT Article-I.D.: brl-adm.9001 Posted: Tue Aug 25 19:57:24 1987 Date-Received: Thu, 27-Aug-87 02:34:30 EDT Sender: news@brl-adm.ARPA Lines: 27 No flame against the poster, but when I saw the following come by today it reminded me of what I think is the absolute *WORST* of the "UNIX philosophy": >>>> #define STRERR() ((errno >=0 && errno < sys_nerr) ? \ >>>> sys_errlist[errno] : "Unknown error") What's wrong with this? Simply that it doesn't tell you what the unknown value of errno *IS*! When I first saw code like this in "perror" itself I absolutely could not believe it. Sure it takes a miniscule amount more work to print "Unknown error 666." But you see, that's *exactly* what I meant by "UNIX philosophy": it's fine as long as you don't ever make a mistake, but boy if you ever should, then not only is UNIX not going to help, it's gonna *HIDE* the one piece of debugging information it has! "The number you reached, which I am not going to tell you so you won't know whether you misdialed or not and will have to try again, is not in service." Sheesh! Wayne Hathaway ultra!wayne@Ames.ARPA Ultra Network Technologies 2140 Bering drive with a domain server: San Jose, CA 95131 wayne@Ultra.COM 408-922-0100