Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: bool versus BOOL in C++

Author: Koundinya Veluri

Date: 10:21:07 09/26/03

Go up one level in this thread


On September 26, 2003 at 10:29:09, Omid David Tabibi wrote:

>http://www.azillionmonkeys.com/qed/optimize.html
>
>"The original reason int was put into the C language was so  that the fastest
>data type on each platform remained abstracted away from the programmer himself.
> On modern 32 and 64 bit platforms,  small data types like chars and shorts
>actually incur extra overhead  when converting to and from the default machine
>word sized data type."
>

That's true, converting from char to int can result in some overhead. But, I was
referring to char to char operations vs int to int operations; they should be
equally fast. Going back to the original topic, bool vs BOOL, I still prefer
bool because a conversion from bool to a larger type is not necessary, so bool
to bool operations and BOOL to BOOL operations should be equally fast. If it is
necessary to convert bool to int then I would consider that bad design.
Nevertheless, in that case BOOL would probably be more appropriate.

Koundinya



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.