TechWhirl (TECHWR-L) is a resource for technical writing and technical communications professionals of all experience levels and in all industries to share their experiences and acquire information.
For two decades, technical communicators have turned to TechWhirl to ask and answer questions about the always-changing world of technical communications, such as tools, skills, career paths, methodologies, and emerging industries. The TechWhirl Archives and magazine, created for, by and about technical writers, offer a wealth of knowledge to everyone with an interest in any aspect of technical communications.
Subject:RE: Lives there a boolean integer? From:"Geoff Lane" <geoff -at- gjctech -dot- co -dot- uk> To:"'Mark L. Levinson'" <markl -at- gilian -dot- com>, "'TECHWR-L'" <techwr-l -at- lists -dot- raycomm -dot- com> Date:Tue, 7 Mar 2000 10:01:33 -0000
Mark L. Levinson wrote:
>
> I'd like to hear from people who are familiar with
> C and with Perl. I'm documenting a number of functions
> that return the integer 1 to indicate success and the
> integer 0 to indicate failure. Because these are the
> only two values ever returned, I'm being encouraged
> to refer to them as boolean values, and I'm
> being told that there's no real confusion involved
> because neither C nor Perl supports a true boolean
> data type.
---
FWIW, I have a similar situation with the product API that I'm currently
documenting. This product treats zero as false and non-zero values as true.
When it returns TRUE, it uses the value -1 (many compilers and interpreters
use -1 because, in two's complement, every bit is set).
There is a way that you can stand by your principle *and* meet the
programmers wishes -- just state that the product *represents* the Boolean
values TRUE and FALSE by non-zero and zero values respectively. In addition,
this may help when you come to explain bitwise operations (where each bit is
considered a separate value). Set (non-zero) bits represent TRUE; cleared
(zero) bits represent FALSE.
HTH,
Geoff Lane
Cornwall, UK
geoff -at- gjctech -dot- co -dot- uk