Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Is there an overhead in this OO design ?

Author: Alexander Kure

Date: 04:55:05 01/06/06

Go up one level in this thread


On January 06, 2006 at 06:41:13, Gerd Isenberg wrote:

[..]

>>
>>The question was: "is there overhead in OO ? "
>
>"Is there overhead in _this_ OO design", aka wrapping a scalar.
>Most likely not.
>
>>
>>Whenever you use a try .. catch  : YES   :)
>
>Not necessarily - try catch is not a pure oo-feature.
>It should simplify control structure - saving some "ifs" in a chain of
>subroutines where some may cause exceptions, specially in recursive functions.
>One if-throw - unwinding the stack and performing a long jump intead of lot of
>returns and ifs.
>
>My "didactical" sample was a bit ironic - but what is the desired behaviour of
>sq.down().left() if sq is A1?
>
>Gerd


Dear Gerd,

You can define these functions to wrap around - I don't know if his actually
makes sense.
The result of sq.down() of square A1 could be A8.
sq.left() of square A1 could be H1.
Similiar for down() and right().

Greetings
Alex



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.