Picky with the pesky names

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Picky with the pesky names

francisco.j.garau
I am writing a test case that looks like this:

        self assert: (level between: -1 and: 1)

I wrote a method in Magnitude to help me write the above expression in a
more readable way.

        self assert: (level inside: -1@1)

Where #inside: is defined as follows:

    Magnitude >> inside: intervalPoint
        "Alternative way of expressing inclusion within an interval
        (0.5 inside: -1@1) = (0.5 between: -1 and: 1)
        "
        ^self between: intervalPoint x and: intervalPoint y

As you can see, the method is trivial, the name is not. Several
alternatives names come to my mind:

        0.5 inside: -1@1
        0.5 in: -1@1
        0.5 within: -1@1
        0.5 included: -1@1
        0.5 belongsTo: -1@1

Any preference? Or am I being too picky with the pesky names?

---
Francisco Garau
0207 777 1362 - x71362


This communication is for informational purposes only. It is not intended
as an offer or solicitation for the purchase or sale of any financial
instrument or as an official confirmation of any transaction. All market prices,
data and other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made herein
do not necessarily reflect those of JPMorgan Chase & Co., its subsidiaries
and affiliates.

Reply | Threaded
Open this post in threaded view
|

Re: Picky with the pesky names

Frank Shearar
<[hidden email]> wrote:

> As you can see, the method is trivial, the name is not. Several
> alternatives names come to my mind:
>
>         0.5 inside: -1@1
>         0.5 in: -1@1
>         0.5 within: -1@1
>         0.5 included: -1@1
>         0.5 belongsTo: -1@1
>
> Any preference? Or am I being too picky with the pesky names?

I won't comment on your pickiness :) but I'd go for #within:. "0.5 is within
the interval (-1, 1)."

If it was ME, I'd stay with #between:and:, because when I see -1@1 I think
of a point on the Cartesian plane, not an interval on the real number line.
But that's just me being picky!

frank


Reply | Threaded
Open this post in threaded view
|

Re[2]: Picky with the pesky names

Herbert König
Hello Frank,


FS> <[hidden email]> wrote:

>> As you can see, the method is trivial, the name is not. Several
>> alternatives names come to my mind:
>>
>>         0.5 inside: -1@1
>>         0.5 in: -1@1
>>         0.5 within: -1@1
>>         0.5 included: -1@1
>>         0.5 belongsTo: -1@1

FS> I won't comment on your pickiness :) but I'd go for #within:. "0.5 is within
FS> the interval (-1, 1)."

Same opinion here.

FS> If it was ME, I'd stay with #between:and:, because when I see -1@1 I think
FS> of a point on the Cartesian plane, not an interval on the real number line.

Also the same opinion.
I also could accept if (-1 ... 1) creates that interval so it would be
0.5 within: (-1 ... 1). But the advantage would be in creating an
interval and not regarding this discussion.



Herbert                            mailto:[hidden email]