Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: [PATCH] more small directional cleanups
Home

[Freeciv-Dev] Re: [PATCH] more small directional cleanups

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Jason Dorje Short <jshort@xxxxxxxxxxxxx>
Cc: Freeciv-dev mailing list <freeciv-dev@xxxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: [PATCH] more small directional cleanups
From: Trent Piepho <xyzzy@xxxxxxxxxxxxx>
Date: Tue, 21 Aug 2001 17:10:20 -0700 (PDT)

On Tue, 21 Aug 2001, Jason Dorje Short wrote:
> So, it's really a question of symantics versus clarity.  IMO,
> is_normal_map_pos is easier to read and understand for technical people,
> however, nontechnical people are more likely to confuse its meaning. 

But are these people programmers who will be reading the code?  When I see
"normal" and some kind of coordinate, I think the mathematical sense.  Not some
kind of a vague "commonplace" sense that might be the more common
non-technical usage.

> is_normalized_map_pos isn't as pretty but implies the technical
> definition ("normalized" is used very little in common speech).

I think you might see it used in a phrase like, "This treaty normalized trade
relations with China." Oh hell....  Real newspaper quotes here:

        Raul Castro advising normalized relations 

        The administration normalized trade relations with China last
        November, and the House recently approved legislation needed to end
        the annual congressional review of China's trade status. 

        "We ended the Trading with the Enemy Act restrictions and normalized
        relations with Vietnam, for gosh sakes," he added. 

I didn't find one that used a mathematical sense.


> Thus I again propose the following functions:
>       normalize_map_pos
>       is_normal(ized)_map_pos
>       is_real_map_pos
> 
> I can't decide whether "map_pos" or "tile" is better, either, but we
> should pick just one and stick to it.  Again "tile" is (IMO) more
> readable while "map_pos" (possibly) more correct.  Finally,
> ensure_normal_map_pos would be a fine add-on function (although IMO
> assert(is_normal_map_pos()) is more legible).

I agree with that.  I'd also like to add that if you use the assert() method,
and compile without debugging, the assert goes away.  If you have a function,
there will still be a function call in there.



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