Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!security!genrad!decvax!harpo!seismo!hao!hplabs!sri-unix!gwyn@brl-vld From: gwyn%brl-vld@sri-unix.UUCP Newsgroups: net.unix Subject: Re: typedefs, etc. Message-ID: <15105@sri-arpa.UUCP> Date: Tue, 3-Jan-84 14:32:13 EST Article-I.D.: sri-arpa.15105 Posted: Tue Jan 3 14:32:13 1984 Date-Received: Sat, 7-Jan-84 02:24:06 EST Lines: 23 From: Doug Gwyn (VLD/VMB) I think one's programming style is improved if he carefully maintains the distinction between boolean data and integer data, even though the C language does not. Examples: if ( p != NULL ) fputs( p, stdout ); rather than if ( p ) fputs( p, stdout ); while ( *p != '\0' ) putchar( *p++ ); rather than while ( *p ) putchar( *p++ ); Although the above alternatives lead to identical machine code and are not obviously superior taken out of context, they say precisely what is intended without requiring the reader to remember C-specific language peculiarities. I find that careful attention to data typing, of which boolean-vs-integer is a small part, contributes to error-free coding.