Slight API curiosity

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Slight API curiosity

Hugi Thordarson
Hi all,
Is there any particular reason why Property has a method called "andExp()" instead of "and()"? ObjectSelect and ExpressionFactory use the "and" method name, so it seems like using the "and" method name would be more consistent (and more readable).

Cheers,
- hugi
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Slight API curiosity

Andrus Adamchik
You mean Expression class has "andExp", not Property?

The answer is "legacy". This API predates Property, ObjectSelect, and other 4.0 additions. It was done long time ago before we figured out our modern vocabulary.

Andrus

> On Jun 16, 2017, at 1:56 PM, Hugi Thordarson <[hidden email]> wrote:
>
> Hi all,
> Is there any particular reason why Property has a method called "andExp()" instead of "and()"? ObjectSelect and ExpressionFactory use the "and" method name, so it seems like using the "and" method name would be more consistent (and more readable).
>
> Cheers,
> - hugi

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Slight API curiosity

Hugi Thordarson
> You mean Expression class has "andExp", not Property?

Whoops—of course I did. Pardon me.


> The answer is "legacy". This API predates Property, ObjectSelect, and other 4.0 additions. It was done long time ago before we figured out our modern vocabulary.

Might be a question of adding a new "and()" method and deprecating "andExp()"?

- hugi


> Andrus
>
>> On Jun 16, 2017, at 1:56 PM, Hugi Thordarson <[hidden email]> wrote:
>>
>> Hi all,
>> Is there any particular reason why Property has a method called "andExp()" instead of "and()"? ObjectSelect and ExpressionFactory use the "and" method name, so it seems like using the "and" method name would be more consistent (and more readable).
>>
>> Cheers,
>> - hugi
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Slight API curiosity

Andrus Adamchik

> On Jun 16, 2017, at 2:54 PM, Hugi Thordarson <[hidden email]> wrote:
>
>>
>> The answer is "legacy". This API predates Property, ObjectSelect, and other 4.0 additions. It was done long time ago before we figured out our modern vocabulary.
>
> Might be a question of adding a new "and()" method and deprecating "andExp()"?

Yeah, we can do it in 4.1

Andrus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Slight API curiosity

Lon Varscsak
In reply to this post by Hugi Thordarson
+1 Woot!

On Fri, Jun 16, 2017 at 4:54 AM, Hugi Thordarson <[hidden email]> wrote:

> > You mean Expression class has "andExp", not Property?
>
> Whoops—of course I did. Pardon me.
>
>
> > The answer is "legacy". This API predates Property, ObjectSelect, and
> other 4.0 additions. It was done long time ago before we figured out our
> modern vocabulary.
>
> Might be a question of adding a new "and()" method and deprecating
> "andExp()"?
>
> - hugi
>
>
> > Andrus
> >
> >> On Jun 16, 2017, at 1:56 PM, Hugi Thordarson <[hidden email]> wrote:
> >>
> >> Hi all,
> >> Is there any particular reason why Property has a method called
> "andExp()" instead of "and()"? ObjectSelect and ExpressionFactory use the
> "and" method name, so it seems like using the "and" method name would be
> more consistent (and more readable).
> >>
> >> Cheers,
> >> - hugi
>
Loading...