Clarity vs. code reuse/generality

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Tue Jul 7 07:05:12 CEST 2009


On Mon, 06 Jul 2009 21:02:19 -0700, Aahz wrote:

> In article <006e795f$0$9711$c3e8da3 at news.astraweb.com>, Steven D'Aprano 
> <steve at REMOVE-THIS-cybersource.com.au> wrote:
>>On Mon, 06 Jul 2009 14:32:10 +0200, Jean-Michel Pichavant wrote:
>>> kj wrote:
>>>>
>>>>     sense = cmp(func(hi), func(lo))
>>>>     assert sense != 0, "func is not strictly monotonic in [lo, hi]"
>>>
>>> As already said before, unlike other languages, sense in english does
>>> **not** mean direction. You should rewrite this part using a better
>>> name. Wrong informations are far worse than no information at all.
>>
>>Absolutely.
>>
>>From Webster's Dictionary:
>>
>>      8. (Geom.) One of two opposite directions in which a line,
>>      surface, or volume, may be supposed to be described by the motion
>>      of a point, line, or surface.
>>      [1913 Webster]
>>
>>
>>And from WordNet:
>>
>>     2: the meaning of a word or expression; the way in which a word
>>        or expression or situation can be interpreted
>>
>>Both meanings are relevant to the way KJ is using the word. Please take
>>your own advice and stop giving wrong information. As a native English
>>speaker, I had no difficulty understanding the meaning of "sense" in the
>>sense intended by KJ.
> 
> As another native English speaker, I agree with Jean-Michel; this is the
> first time I've seen "sense" used to mean direction.


Just goes to show you learn something new all the time.

http://www.merriam-webster.com/dictionary/sense

    7: one of two opposite directions especially of motion (as 
    of a point, line, or surface)


http://dictionary.reference.com/browse/sense

    18.  Mathematics. one of two opposite directions in which 
    a vector may point.



Paraphrasing the Collins Dictionary of Mathematics:

The sense of a vector is the sign of the measure, contrasted with the 
magnitude. Thus the vectors AB and BA have the same direction but 
opposite sense. Sense is also used to distinguish clockwise and anti-
clockwise.

Sense is, if you like, a "signed direction". "Towards north" (say) as 
opposed to "along the north-south axis".



-- 
Steven



More information about the Python-list mailing list