The Trunk: Graphics-mt.404.mcz

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

Re: The Trunk: Graphics-mt.404.mcz

cbc


On Thu, Dec 6, 2018 at 9:46 AM Bert Freudenberg <[hidden email]> wrote:
On Wed 5. Dec 2018 at 23:35, marcel.taeumel <[hidden email]> wrote:
I think that we got used to seeing "0@0 corner: 10@10" as a rectangle. Like
"0@0 to: 10@10" might create a line (or an interval over points? The same?
:-). Yet, "0@0 extent: 10@10" could also be a line or a vector.

I like the verb-vs-noun argument. So, following Nicolas', Eliot's, and
David's thoughts, I vote for:

Point >> #center:

+1

It's decent, but I would assume that the ARGUMENT is the center, not the receiver.  As long as the callers name the variables well that might not be a problem, but

10@10 center: 5@5

reading it without the discussion here, which would you assume the center to be? 10@10 or 5@5? 

Maybe #centerWithExtent:? 
   10@10 centerWithExtent: 5@5

-cbc


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Graphics-mt.404.mcz

David T. Lewis
On Thu, Dec 06, 2018 at 01:33:57PM -0800, Chris Cunningham wrote:

> On Thu, Dec 6, 2018 at 9:46 AM Bert Freudenberg <[hidden email]>
> wrote:
>
> > On Wed 5. Dec 2018 at 23:35, marcel.taeumel <[hidden email]> wrote:
> >
> >> I think that we got used to seeing "0@0 corner: 10@10" as a rectangle.
> >> Like
> >> "0@0 to: 10@10" might create a line (or an interval over points? The
> >> same?
> >> :-). Yet, "0@0 extent: 10@10" could also be a line or a vector.
> >>
> >> I like the verb-vs-noun argument. So, following Nicolas', Eliot's, and
> >> David's thoughts, I vote for:
> >>
> >> Point >> #center:
> >
> >
> > +1
> >
> > It's decent, but I would assume that the ARGUMENT is the center, not the
> receiver.  As long as the callers name the variables well that might not be
> a problem, but
>
> 10@10 center: 5@5
>
> reading it without the discussion here, which would you assume the center
> to be? 10@10 or 5@5?
>
> Maybe #centerWithExtent:?
>    10@10 centerWithExtent: 5@5
>

+1

I think it may have been me who suggested #center: so I will say that
I think #centerWithExtent: is more readable, and remains consistent
with the existing #corner: and #extent: methods.

Dave

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Graphics-mt.404.mcz

Tobias Pape

> On 07.12.2018, at 01:29, David T. Lewis <[hidden email]> wrote:
>
> On Thu, Dec 06, 2018 at 01:33:57PM -0800, Chris Cunningham wrote:
>> On Thu, Dec 6, 2018 at 9:46 AM Bert Freudenberg <[hidden email]>
>> wrote:
>>
>>> On Wed 5. Dec 2018 at 23:35, marcel.taeumel <[hidden email]> wrote:
>>>
>>>> I think that we got used to seeing "0@0 corner: 10@10" as a rectangle.
>>>> Like
>>>> "0@0 to: 10@10" might create a line (or an interval over points? The
>>>> same?
>>>> :-). Yet, "0@0 extent: 10@10" could also be a line or a vector.
>>>>
>>>> I like the verb-vs-noun argument. So, following Nicolas', Eliot's, and
>>>> David's thoughts, I vote for:
>>>>
>>>> Point >> #center:
>>>
>>>
>>> +1
>>>
>>> It's decent, but I would assume that the ARGUMENT is the center, not the
>> receiver.  As long as the callers name the variables well that might not be
>> a problem, but
>>
>> 10@10 center: 5@5
>>
>> reading it without the discussion here, which would you assume the center
>> to be? 10@10 or 5@5?
>>
>> Maybe #centerWithExtent:?
>>   10@10 centerWithExtent: 5@5
>>
>
> +1
>
> I think it may have been me who suggested #center: so I will say that
> I think #centerWithExtent: is more readable, and remains consistent
> with the existing #corner: and #extent: methods.
>

Why not both?
        #centerWithExtent: AND #centerWithCorner:

:)
-t


> Dave


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Graphics-mt.404.mcz

marcel.taeumel
In reply to this post by David T. Lewis
We could tread the receiver as extent in this case and see how it works out?

(50@50 center: 5@5) = (Rectangle center: 5@5 extent: 50@50).

Best,
Marcel


David T. Lewis wrote
> On Thu, Dec 06, 2018 at 01:33:57PM -0800, Chris Cunningham wrote:
>> On Thu, Dec 6, 2018 at 9:46 AM Bert Freudenberg &lt;

> bert@

> &gt;
>> wrote:
>>
>> > On Wed 5. Dec 2018 at 23:35, marcel.taeumel &lt;

> Marcel.Taeumel@

> &gt; wrote:
>> >
>> >> I think that we got used to seeing "0@0 corner: 10@10" as a rectangle.
>> >> Like
>> >> "0@0 to: 10@10" might create a line (or an interval over points? The
>> >> same?
>> >> :-). Yet, "0@0 extent: 10@10" could also be a line or a vector.
>> >>
>> >> I like the verb-vs-noun argument. So, following Nicolas', Eliot's, and
>> >> David's thoughts, I vote for:
>> >>
>> >> Point >> #center:
>> >
>> >
>> > +1
>> >
>> > It's decent, but I would assume that the ARGUMENT is the center, not
>> the
>> receiver.  As long as the callers name the variables well that might not
>> be
>> a problem, but
>>
>> 10@10 center: 5@5
>>
>> reading it without the discussion here, which would you assume the center
>> to be? 10@10 or 5@5?
>>
>> Maybe #centerWithExtent:?
>>    10@10 centerWithExtent: 5@5
>>
>
> +1
>
> I think it may have been me who suggested #center: so I will say that
> I think #centerWithExtent: is more readable, and remains consistent
> with the existing #corner: and #extent: methods.
>
> Dave





--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Graphics-mt.404.mcz

David T. Lewis
On Fri, Dec 07, 2018 at 04:17:49AM -0600, marcel.taeumel wrote:
> We could tread the receiver as extent in this case and see how it works out?
>
> (50@50 center: 5@5) = (Rectangle center: 5@5 extent: 50@50).

That definitely reads more clearly, but in Point>>corner: and Point>>center:
the receiver is used to establish the position of the new rectangle, and
the argument establishes the size. It may be best to keep that convention.

Dave


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Graphics-mt.404.mcz

marcel.taeumel
We could add Point >> #origin: *and* Point >> #center:, which could both
treat the receiver as extent. That interface would complement Point >>
#corner: and Point >> #extent:.

Best,
Marcel


David T. Lewis wrote

> On Fri, Dec 07, 2018 at 04:17:49AM -0600, marcel.taeumel wrote:
>> We could tread the receiver as extent in this case and see how it works
>> out?
>>
>> (50@50 center: 5@5) = (Rectangle center: 5@5 extent: 50@50).
>
> That definitely reads more clearly, but in Point>>corner: and
> Point>>center:
> the receiver is used to establish the position of the new rectangle, and
> the argument establishes the size. It may be best to keep that convention.
>
> Dave





--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html

12