[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re[2]: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool:
From: |
Manuel Guesdon |
Subject: |
Re[2]: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?) |
Date: |
Fri, 30 Jan 2004 20:08:03 +0100 (CET) |
On Fri, 30 Jan 2004 17:11:42 +0000 (GMT) Nicola Pero <address@hidden> wrote:
>| I don't have particular objections to change 'if ([this canDoThat] ==
>| YES)' into 'if ([this canDoThat])', if we write clearly in the coding
>| standards that this can be done only for methods returning a BOOL, and
>| that everything else (pointers, integers, etc) must be compared against
>| something. So whenever you'd see 'if ([this doThat])' you know that the
>| result type must have been a BOOL since it's compared to nothing.
I think that
if (MyPtr)
is more readable than
if (MyPtr == NULL)
because it's shorter and still easily understandable buts it's only my opinion
:-)
This last one can also be a source of typos like
if (MyPtr = NULL)
even if compiler often emit a warning for this case.
Richard's IsYes() macro proposition seems interesting when you know that the
method should return a 'real' BOOL.
Just my 2 cents...
Manuel
--
______________________________________________________________________
Manuel Guesdon - OXYMIUM <address@hidden>
14 rue Jean-Baptiste Clement - 93200 Saint-Denis - France
Tel: +33 1 4940 0999 - Fax: +33 1 4940 0998
- Re: Problem with +numberWithBool: ?, (continued)
- Re: Problem with +numberWithBool: ?, Alexander Malmberg, 2004/01/29
- Re[2]: Problem with +numberWithBool: ?, Manuel Guesdon, 2004/01/29
- Re: Problem with +numberWithBool: ?, Helge Hess, 2004/01/30
- [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?), Alexander Malmberg, 2004/01/30
- Re: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?), David Ayers, 2004/01/30
- Re: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?), Nicola Pero, 2004/01/30
- Re[2]: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?),
Manuel Guesdon <=
- Re[2]: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?), Nicola Pero, 2004/01/30
- Re[3]: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?), Manuel Guesdon, 2004/01/30
- Re: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?), David Ayers, 2004/01/31
- Re: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?), Richard Frith-Macdonald, 2004/01/31
- Re: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?), David Ayers, 2004/01/31
- Re: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?), David Ayers, 2004/01/31
- Re: [RFA]: BOOL coding standards (Was: Problem with+numberWithBool: ?), Alexander Malmberg, 2004/01/31
- Re: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?), Kazunobu Kuriyama, 2004/01/30
- Re: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?), Richard Frith-Macdonald, 2004/01/30
- Re: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?), Richard Frith-Macdonald, 2004/01/30