Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: C or C++ for chess programming: speed

Author: Dann Corbit

Date: 10:14:59 10/20/99

Go up one level in this thread


On October 20, 1999 at 09:26:39, Marc-Philippe HUGET wrote:
>Hi,
>
>In one article, B. Stroustrup said that good programs in C++ are quickier than
>programs in C (The C/C++ Users journal).
>Do you think translating my program from C to C++ can really improve the speed
>and consequently the nps?

The programming language is almost irrelevant.  The fundamental algorithm choice
will determine the program's speed.  If you use templates on vector machines
then C++ may give you a speedup.  I would be stunned if a quick change to C++
will do anything to make your program faster.  I have written hundreds of
thousands of lines in both languages.

The biggest benefit to C++ is abstraction.  The use of objects and templates can
make your programs more generic and easier to understand.  If you are choosing
C++ to make your programs faster then you are making a mistake.

Mr. Stroustrup is the "inventor" of C++ so I think he is a tad bit biased.  I
have seen him "stretch it" a bit at times with other claims concerning his
language.

Personally, I like C++ but I think if you have not programmed in C++ it will
take at least two years before you are any good at it.




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