[Freeciv-Dev] Re: Map coordinate cleanups.
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Thu, 16 Aug 2001, jshort@xxxxxxxxxxxxx wrote:
> Gaute B Strokkenes wrote:
>
> I think any benefit players may get from extra speed is more than
> negated by the extra work developers have to do to use a macro for
> these functions.
What extra work? There is zero extra work, in all but the most
unlikely of circumstances. ("Unlikely" in this case means that in the
entirety of the Freeciv source there is not a single spot where this
makes a difference; I know because I checked before making the patch.)
> Thus I agree that there is no _good_ reason to make it a macro.
>
> In summary, I don't think these functions should be made macros.
> Efficiency must be balanced with code cleanliness.
I see zero code cleanliness issues with having these functions as
macros, other than a general "macros must be bad" attitude.
>> I haven't redefined anything; there is no evidence anywhere in the
>> current sources that this has been given any thought at all.
>
> As I see it, you've redefined "normal", never mind that the original
> definition may have been by accident.
>
>> In any case my point is that
>>
>> Stepping of the edge of the world.
>>
>> and
>>
>> Accidentally forgetting to wrap an x coordinate.
>>
>> are DIFFERENT kinds of error, and accordingly you want to be able
>> to detect either kind or both according to your needs.
>
> You're right on this point; I understand what you're saying entirely
> I just disagree with your naming. I would name things like this:
>
> real tile: a coordinate position that is on the world
> proper tile: a coordinate that is canonically wrapped
> normal tile: one that is both real and proper
Ah, I think I can see where you're coming from now.
In mathematics, it is often the case that when dealing with an object
or group of objects that there is a more-or-less arbitrary choice,
based on convenience or simplicity, between objects or
representations. For instance, suppose that I want to represent the
heading of the antenna on a space satelite. The natural way to do
that is to use a 3D vector. However, there are lots of vectors that
could be used. The usual thing to do is to divide the vector by its
length, a process known as normalisation. After normalisation, there
is only one, unique vector for each given heading.
It seemed obvious to me that the phrase "normalize_map_pos" had been
picked because of the meaning of normal or normalized as "in the
preferred form" rather than the commonplace meaning as "plain,
ordinary" which is how you seem to be interpreting it.
I then picked "proper" because that is the word which is most often
used to exclude objects which fit the definition, but are not `nice'.
For instance given a set A, A is a subset of A--but it is not a proper
subset.
I suppose it's my fault for not remembering that not everyone has the
same background as I do. I'll make sure that I document this
properly.
> Currently normalize_map_pos takes care of both, checking both
> validity and wrapping - which is why I believe my naming system is
> most consistent with what's currently in freeciv.
normalize_map_pos() has the return value that it has because that is
obviously the most useful thing for it to return. If you look at the
comment, you will see that it states "returns TRUE if it is real". I
don't think it is reasonable to extrapolate the meaning of the word
"normal" based on this.
--
Big Gaute http://www.srcf.ucam.org/~gs234/
Hey!! Let's watch the' ELEVATOR go UP and DOWN at th' HILTON HOTEL!!
- [Freeciv-Dev] Re: Map coordinate cleanups., (continued)
- [Freeciv-Dev] GTK client draws more slowly than it needs to, Kevin Brown, 2001/08/19
- [Freeciv-Dev] Re: GTK client draws more slowly than it needs to, Raimar Falke, 2001/08/20
- [Freeciv-Dev] Re: Map coordinate cleanups., Kevin Brown, 2001/08/19
- [Freeciv-Dev] Re: Map coordinate cleanups., Ross W. Wetmore, 2001/08/19
- [Freeciv-Dev] Re: Map coordinate cleanups., Kevin Brown, 2001/08/19
- [Freeciv-Dev] Re: Map coordinate cleanups., Raimar Falke, 2001/08/20
- [Freeciv-Dev] Re: Map coordinate cleanups., Raimar Falke, 2001/08/16
- [Freeciv-Dev] Re: Map coordinate cleanups., Trent Piepho, 2001/08/16
- [Freeciv-Dev] Re: Map coordinate cleanups.,
Gaute B Strokkenes <=
- [Freeciv-Dev] Re: Map coordinate cleanups., Trent Piepho, 2001/08/16
- [Freeciv-Dev] Re: Map coordinate cleanups., Gaute B Strokkenes, 2001/08/17
[Freeciv-Dev] Re: Map coordinate cleanups., Raimar Falke, 2001/08/16
- [Freeciv-Dev] Re: Map coordinate cleanups., Andreas Kemnade, 2001/08/16
- [Freeciv-Dev] Re: Map coordinate cleanups., Raimar Falke, 2001/08/16
- [Freeciv-Dev] Re: Map coordinate cleanups., Marco Colombo, 2001/08/16
- [Freeciv-Dev] Re: Map coordinate cleanups., Raimar Falke, 2001/08/16
- [Freeciv-Dev] Re: Map coordinate cleanups., Marco Colombo, 2001/08/16
- [Freeciv-Dev] Re: Map coordinate cleanups., Raimar Falke, 2001/08/16
- [Freeciv-Dev] Re: Map coordinate cleanups., Kevin Brown, 2001/08/16
|
|