gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?)


From: Richard Frith-Macdonald
Subject: Re: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?)
Date: Fri, 30 Jan 2004 17:07:41 +0000


On 30 Jan 2004, at 16:00, Alexander Malmberg wrote:

Manuel Guesdon wrote:
My rule: be strict for output and flexible for input :-)

A very good rule. :)

http://www.faqs.org/docs/jargon/P/Postel's-Prescription.html

So what do we do ?

I've attached a patch to our coding standards. OK to commit? If so, new
code will work ok, and I'll get to work on patching core/ (hopefully
with some help from David Ayers :).

Predictably perhaps,  I don't really like it ...

I think the idea a boolean type is an improvement over C, and it worries
me that being too tolerant will encourage bad coding (and may make
the code less readable).

If we want to mandate a standard way of testing the results of an operation
which is supposed to return a BOOL, perhaps use of a macro might be
better.
eg.

if (IsYes([receiver aMessage])) ...

Where the macro could log a warning or raise an exception (or do nothing)
for a non YES/NO value depending on a developers preferences.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]