From owner-freebsd-hackers Wed Mar 6 21:48:28 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.junkproof.net (mail.junkproof.net [206.55.70.12]) by hub.freebsd.org (Postfix) with ESMTP id 4070037B41A for ; Wed, 6 Mar 2002 21:48:25 -0800 (PST) Received: from mail (helo=mail.junkproof.net) by mail.junkproof.net with local-bsmtp (Exim 3.32 #1) id 16iqlH-000Ozx-00 for freebsd-hackers@freebsd.org; Wed, 06 Mar 2002 23:48:19 -0600 X-Filter-Status: mail.junkproof.net ok 656 Received: from bill.twwells.com ( [68.44.48.161] ) by mail.junkproof.net via tcp with submission id 3c86fc93-01767e; Wed, 6 Mar 2002 23:37:23 -0600 Received: from bill by bill.twwells.com with local (Exim 3.34 #1) id 16iqag-0002DA-00 for freebsd-hackers@freebsd.org; Thu, 07 Mar 2002 00:37:22 -0500 From: admin@twwells.com Subject: Re: RFC: style(9) isn't explicit about booleans for testing. References: <200203061659.g26GxI979195@thistle.bogs.org> To: freebsd-hackers@freebsd.org Message-Id: Date: Thu, 07 Mar 2002 00:37:22 -0500 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Try this text instead: In C, there is no boolean type but there are boolean concepts, contexts that express or test yes/no, good/bad, error/success, pointer initialized/not initialized, object created/not created, and so on. Where a conceptually boolean operand is expected and you have a value that is not conceptually boolean, use an operator (e.g., ==, !=) that translates the operand to something that is conceptually boolean. This applies to "if" expressions, the operand of !, function parameters that want a conceptually boolean value, and so on. This is actually a special case of a more general rule, which might be stated: saving a few keystrokes but violating the expectations of strangers reading your code is not a good way to write maintainable code. Ensure that the code and your intention are congruent *in the mind of your readers*. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message