Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: c,c++5,c#.

Author: Sune Fischer

Date: 14:53:58 08/11/04

Go up one level in this thread


On August 11, 2004 at 17:41:06, Omid David Tabibi wrote:

>On August 11, 2004 at 15:33:16, Sune Fischer wrote:
>
>>On August 11, 2004 at 09:42:04, gerold daniels wrote:
>>
>>>what is the best to program a chess game in. c.c++,c#. which is the easy one to
>>>learn and the best to program in.
>>
>>Different languages are good for different things.
>>I'd pick C# for a nice GUI on windows.
>>I'd pick Java for a GUI with good portability qualities.
>>
>>For chess, since you ask, it must be fast so either C or C++.
>>
>>Personally I see no reason to use C, C++ offers a lot more and there's
>>no speed penalty.
>
>No speed penalty only when you know exactly how to use it, and what C++ features
>to avoid using. For that, you need a good deal of experience in C programming.
>
>"C makes it easy to shoot yourself in the foot; C++ makes it harder, but when
>you do it blows your whole leg off." --Bjarne Stroustrup

Yeah, there are some rules of thumb here.
In inner loops, avoid function calls and dynamic allocation, and use only local
(unsigned) integer arrays/values.

If it's not in an inner loop, it's not likely to be a hot spot.
Of course in chess the bulk of the code is in an inner loop! :)

Still, I think those last few percent are worth structuring well.

-S.



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.