Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: I'm Confused. C, C++, C#. Which to Use?

Author: Tom Likens

Date: 18:33:31 11/16/02

Go up one level in this thread


On November 16, 2002 at 11:45:27, Bob Durrett wrote:

>
>I'm Confused.  C, C++, C#.  Which to Use?
>
>I have an old Visual C++ compiler which I purchased many ago.
>But bulletins posted here seem to favor C, as opposed to C++ as
>if C is better than C++ for chess engine programming.
>
>Still trying to find the best C compiler to use for chess engine
>design on my Compaq 1 GHz 1GB RAM single-processor PC.
>
>Tried to download one but got error message saying NO!
>
>Yahoo! seems to find C++ compilers but not C compilers.
>
>Sorry for sounding like a child.  : (
>
>Bob D.

Hello Bob,

The truth be told you can write a strong chess program in either
C or C++ (I suspect the same is true of C#, but I've never used it
so I won't make an general statements).  That being said I'd
recommend C for a more basic reason.  There are a large number of
free tools that you can use to debug your program as you develop
it (which unfortunately you will spend a lot of time doing).

Some of those free tools are valgrind, electric-fence and LcLint
among others.  In fact, if you use gcc you can even patch it
so that it will check array bounds for you automatically.  A real
plus since this is a fundamental weakness (or strength depending
on your perspective) of both C and C++.  Unfortunately, these
programs don't support C++ as well as C.  You can buy professional
programs that will do the job but they can be *very* expensive.

If you use these tools from the start your program will be more
robust and your hair less gray ;)  Another advantage is that your
fundamental core routines, such as the move generator, hash table,
search, evaluation etc. will be solid.

Good luck with your program, it is a *very* addictive hobby
so be prepared to kiss a large portion of your spare time
good-bye :)

regards,
--tom



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.