Computer Chess Club Archives


Search

Terms

Messages

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

Author: Sune Fischer

Date: 12:07:51 08/12/04

Go up one level in this thread


On August 12, 2004 at 06:01:32, Tord Romstad wrote:

>On August 11, 2004 at 15:33:16, Sune Fischer wrote:
>
>>For chess, since you ask, it must be fast so either C or C++.
>
>I don't quite agree.  Speed is vastly overrated in computer chess.
>Except for a few games between the top professional engines, speed
>is rarely the decisive factor.  Bugs and efficiency on a higher
>level (i.e. good algorithms) are far more important.

I know what you mean of course, but speed really is a factor in computer chess.
It's not the most important factor, but not something to be ignored either.

>It is better to just choose some language with which you feel comfortable,
>and with which you are able to write clear and reasonably bug-free code.

I'm not sure I see the point of writing an engine in a slow language, why
handicap yourself from the beginning?
Do you not want to write the best engine you can?

Learning a new language is never a bad idea anyway. :)

>It should be a language with an optimizing compiler which compiles to
>native machine code, but there are plenty of languages to choose from.
>Ada, C, Delphi, Lisp and ML are some of the possibilities.  Any of these
>languages should be fast enough to bring you up to the level of the top
>amateur engines.

If they are as fast as C, then yes.

>>Personally I see no reason to use C, C++ offers a lot more and there's
>>no speed penalty.
>
>There is a portability penalty, though.

AFAIK only for cell phones.
I'm not interested in that market myself, it's not what I consider "stable",
yet.
Too many new technologies all the time, new operating systems, new chips,
rapidly growing memory. I wouldn't know what to target and develop for.

Just the thought of writing a small GUI for those and having to update that GUI
with every 6 month generation cycle. It'd be a full time job with no time for
the PC version.

> And although C++ may offer a lot
>more, I don't see why you need a lot more.

But it doesn't hurt, that's my point.

You can live without a debugger too, but if you know how to use a debugger you
wouldn't want to be without one :)

>>C is a smaller language and easier to learn, but you might pick up some bad
>>habits that will take you a while to get rid of if you move on to OOP. I'm
>>talking from experience here.
>
>C and C++ are both bad as first languages, IMHO.

I think the first language should be one with strong type checking, so you
develop the right mindset from the beginning.

C++ is much better than C here.
Java or others might be even better though.

>>It is estimated that C# is about 3 times faster than C++ (MFC) to develop in, so
>>for applications that aren't speed critical C# would probably be the obvious
>>choice.
>
>3 times faster is not much.  I have never programmed in C# myself, but if
>the 3 times faster than C++ estimate is correct,

Three times faster is a lot.
Ask any employer if he would like to be able to cut down his staff by 66% due to
increased efficiency. :)

>I really hope C# is not the
>future.

From what I understand MS has stopped development on MFC and Visual Basic, C# is
their .NET flagship now.

-S.
>Tord



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.