Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: C or C++ for Chess Programming?

Author: Dann Corbit

Date: 14:12:46 08/16/00

Go up one level in this thread


On August 16, 2000 at 17:06:18, Severi Salminen wrote:

>>The efficiency difference is not important enough to worry about.  Any
>>differences in strength will be far more dominated by your choice of algorithms
>>than by your choice of compiler.  The biggest difference a compiler will make >is a small constant factor.
>
>What I ment was the difference between C and C++ in efficiency? Do objects have
>any tendency to be faster/slower than traditional implementations of same
>algorithms?

Depends on what you use.

Try/Catch will give you about 1% speed penalty.  I don't think that will break
the bank.  And RTTI is expensive, but if you already know the types of your
objects in advance, you won't have to use it.

The real difference in speed between an object model and a procedural model
might be 5% or less (probably 1 or 2 ELO).  On the other hand, I think OO models
are a lot easier to understand and maintain.  Hence, you can improve them more
rapidly.

The difference in choices of algorithm can make orders of magnitude of
difference.  That is the place to focus your effort.

>>I would write in whichever I was more comfortable with, if I were you.  Since
>>you are new to OOP, I suspect your C++ implementation would be dissapointing.
>>On the other hand, it would be a good way to learn the language better.
>
>>You will be dissapointed with the free Borland compiler for Chess programming.
>>If you just want something free, I think you will find that Cygnus GCC emits
>>better binaries.
>
>Well, the compiler performance is not a big issue here as I can allways chance
>to more efficient compiler. I hope Borland follows the normal ANSI-C
>standards... Where can this Cygnus GCC be found?

At redhat.



This page took 0.01 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.