Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2001:
[Freeciv-Dev] Re: PATCH: remove map_adjuxt_[xy] invocations
Home

[Freeciv-Dev] Re: PATCH: remove map_adjuxt_[xy] invocations

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gaute B Strokkenes <gs234@xxxxxxxxx>
Cc: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>, jdorje@xxxxxxxxxxxxxxxxxxxxx, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: PATCH: remove map_adjuxt_[xy] invocations
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 23 Oct 2001 10:30:39 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Tue, Oct 23, 2001 at 03:28:42AM +0100, Gaute B Strokkenes wrote:
> On Tue, 09 Oct 2001, rwetmore@xxxxxxxxxxxx wrote:
> 
> > I sometimes worry about absorbing too much German influence, but I
> > actually like adding the "_checked" or "_unchecked" suffixes to 
> > distinguish nearly identical macros/functions. I actually prefer to
> > use "_unchecked" for the dangerous one, because most people are lazy
> > enough in typing and if they find the short default, they don't do
> > serious damage, just performance.
> 
> I think it is a bad idea to have to have two versions (one `safe' and
> one `unsafe') of all/some functions that take positions as arguments.
> 
> That way, every time you change the logic in a function you have to
> check whether or not you should from _checked to _unchecked or vice
> versa.  Better to just use real, normalised coordinates everywhere.
> As an added bonus, you have to consider what you wish to do in the
> unreal case everywhere you use the functions (easy), rather than come
> up with a default that suits all the uses of the function (hard).

Ack. And you gain performance because of fewer checks.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "I heard if you play the NT-4.0-CD backwards, you get a satanic message."
 "That's nothing, if you play it forward, it installs NT-4.0"


[Prev in Thread] Current Thread [Next in Thread]