Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: OOP - Is this possible?

Author: Frank Schneider

Date: 09:22:13 03/27/02

Go up one level in this thread


Hi,

On March 27, 2002 at 06:25:12, Arshad F. Syed wrote:

>I plan to write a chess program. I was wondering if it would be worthwhile to
>use the OOP approach. I have visited some sites of chess programs using OOP. The
>general consensus is that OOP would cause a big hit on the NPS.

i don't think so. Putting code into c++-methods instead of
c-functions does not make it slower. Of course you should be
careful with some OO-features (virtual function calls, runtime casts).
On the other hand it is not slow to use a class like

class move {
public:
inline getSomething() {...}
inline setSomething() {...}
... lots of methods ...
private:
FIXED16 move; // or something similar
}

An advantage of c++ is that you can use templates.

Frank

> Is it possible
>with some really good programming to write an OOP based program that would have
>the same NPS as the same program written without using OOP?
>
>Regards,
>Arshad Syed



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.