Re: Avoiding Booleans & Danny Thorpe
- From: Andre Kaufmann <andre.kaufmann.bei@xxxxxxxxxxx>
- Date: Sun, 30 Oct 2005 18:31:59 +0100
John Herbster wrote:
"Andre Kaufmann" <andre.kaufmann.bei@xxxxxxxxxxx> wrote
CreateFile(cmCreateNew); is much more readable than CreateFile(true); With the latter one I don't have any clue what's the parameter for.
Which is why I try to code CreateFile( {CreateNew}true ); where comment CreateNew will give the reader a hint as to what the parameter is for.
Good idea, I do that too for functions I cannot change.
But if you are implementing the function, what would be
the benefit of using a boolean parameter and additionally adding it's purpose as comment compared to adding it to the variable name itself ?
--JohnH
.
- References:
- Avoiding Booleans & Danny Thorpe
- From: Kyle A. Miller
- Re: Avoiding Booleans & Danny Thorpe
- From: John Herbster
- Avoiding Booleans & Danny Thorpe
- Prev by Date: Re: Avoiding Booleans & Danny Thorpe
- Next by Date: Re: Avoiding Booleans & Danny Thorpe
- Previous by thread: Re: Avoiding Booleans & Danny Thorpe
- Next by thread: Re: Avoiding Booleans & Danny Thorpe
- Index(es):
Relevant Pages
|