Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Any reason to use C?

Author: Dieter Buerssner

Date: 11:31:43 07/29/03

Go up one level in this thread


On July 29, 2003 at 09:38:30, Sune Fischer wrote:

>Absolutely, operator overloading rocks.
>Just try working with vectors and matrices in C :o

In many cases, overloading might be nice for matrix/vector computations. In my
practical experience, however, I would not have found too much good use for it.
I did a lot of quantum mechanical simultions. Often matices have a special
symmetry, that the algorithms want to take advantage of. With the classical way
(function calls instead of operators) I have visual feedback of what happens
behind the scene (say a function start may start like sparse_antisymmetric_...).
To get a real comlete system of overloaded operators seems almost impossible.
Then, say you want to call Eigenvalues. There are different algorithms, and
specific situations will call for a specific algorithm.

I found overloading really useful for checking numerical stability. Instead of
double, I use something like my_floating_point_type. Then I can easily plug in a
100 digit precision floating point class. Something like this would be very hard
and error prone work, without operator overloading.

For chess engines: I use C in my engine, but there is one point, where I miss
C++: formating of the output. With C++, changing 32 bit counters (for nodes,
etc.) to 64 bit counters, could be rather easy. With C-printf-style formating,
it is a lot of work (change all format strings).

Regards,
Dieter



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.