Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!pwa-b!mmintl!franka From: franka@mmintl.UUCP (Frank Adams) Newsgroups: net.lang.c Subject: Re: Boolean Operators Slighted in C Message-ID: <1505@mmintl.UUCP> Date: Sun, 25-May-86 22:35:07 EDT Article-I.D.: mmintl.1505 Posted: Sun May 25 22:35:07 1986 Date-Received: Wed, 28-May-86 05:59:59 EDT References: <822@brl-smoke.ARPA> Reply-To: franka@mmintl.UUCP (Frank Adams) Organization: Multimate International, E. Hartford, CT Lines: 25 In article <822@brl-smoke.ARPA> rbj%icst-cmr@smoke.UUCP writes: > I find data abstraction to be a Good Thing, and have produced > much better code since defining a Boolean data type and using > it in a strictly type-correct manner. > >This fact doesn't bother people who write in APL, widely considered >to be the most mathematical language. Why does it bother you? When I was writing in APL, I found that a necessary part of writing good code was always knowing what the data I was dealing with was. (This doesn't mean that one cannot write a function which works for more than one data type; just that one must explicitly know that that is what one is writing.) If I wrote AxB, I knew whether A was a Boolean or a number; the ability to declare it could only have helped. The fact that one can map Booleans into numbers, and thereby get a number of Boolean operators from the arithmetic ones, is one of those great mixed blessings. There is a real loss in readability when one takes advantage of such things, as C and APL both do. I think Pascal and ADA are closer to the mark here, regarding Boolean as an instance of an enumeration type. This is not merely clever; it is correct. Frank Adams ihnp4!philabs!pwa-b!mmintl!franka Multimate International 52 Oakland Ave North E. Hartford, CT 06108