Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: RE: OO Design

Author: Mathieu Pagé

Date: 09:44:36 08/29/03

Go up one level in this thread


On August 29, 2003 at 11:32:25, Rémi Coulom wrote:

>If you are worried about performance and good OO design, my advice would be:
> - Know what the compiler does. Unlike C, the C++ syntax sometimes "hides"
>complex mechanisms (virtual function calls, exceptions, run-time type
>information). It is good to understand what code your compiler generates. Once
>you understand this, you should be able to write C++ code that is not slower
>than C code.

yes, good advice :)

> - Don't make your code more reusable than it will be actually reused.

it will probably not be. maybe except for the classes that will read pgn files.
I dont plan to make my engines specifics classes reusable,

> - OO design is a software engineering technique, not a low-level programming
>technique. You do not have to define classes with virtual functions for every
>small data type. "int" is perfectly OK for squares or pieces, in my opinion.

Your right. I use int for squares and an enum for the pieces.

>Good luck with your program,

Merci :)

Mathieu Pagé



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.