Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site mmintl.UUCP Path: utzoo!linus!philabs!pwa-b!mmintl!franka From: franka@mmintl.UUCP (Frank Adams) Newsgroups: net.lang.c Subject: Re: Cryptic C (YES/NO vs. TRUE/FALSE + other thoughts) Message-ID: <625@mmintl.UUCP> Date: Mon, 26-Aug-85 23:01:24 EDT Article-I.D.: mmintl.625 Posted: Mon Aug 26 23:01:24 1985 Date-Received: Thu, 29-Aug-85 23:44:50 EDT References: <2913@ncsu.UUCP> <709@brl-tgr.ARPA> <5884@utzoo.UUCP> <989@gatech.CSNET> Reply-To: franka@mmintl.UUCP (Frank Adams) Organization: Multimate International, E. Hartford, CT Lines: 33 Summary: Aggregates are even better In article <989@gatech.CSNET> arnold@gatech.CSNET (Arnold Robbins) writes: > >Well, this can get carried too far. I have worked with code based on >Software Tools stuff that looks like > > dowrite (file, YES, NO, NO, YES); > >Now, can you tell what the heck it is doing? Especially when the code for >dowrite() is 700 lines down in another file? I've often thought that a style >like > >#define FORCEWRITE 1 >#define NOFORCE 0 > >#define APPEND 1 >#define NOAPPEND 0 > > dowrite (file, FORCEWRITE, APPEND, ....); /* call */ > > >is much clearer than the first style. This is the kind of thing, if anything, >that "enums" would be most useful for (no flames about how poorly enums are >implemented. I'm talking conceptually here.). The problem with your solution is I can just easily write dowrite(file, APPEND, NOFORCE, ...) and will have a terrible time finding the error. This is where Ada wins: dowrite(file, append=>true, force=>false, ...) is clear, simple, and error-resistant.