geode-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Hanson <mhan...@pivotal.io>
Subject Re: [Discuss] Use of -1 as Infinite/All for retry related functions...
Date Wed, 06 Sep 2017 23:53:20 GMT
To be sure, if we find particular API bad/unclear/misnamed, a change is
always easy to justify.

On Wed, Sep 6, 2017 at 4:37 PM, Mark Hanson <mhanson@pivotal.io> wrote:

> To play devil's advocate,
>
> I have dealt with -1 for years in network development among other places.
> In just about every case, it has not been a problem. The only cases I can
> think of where it has gotten weird in recent memory are badly designed API
> such as the retry attempts because the API should have really been called
> attempts... Why is this a big enough problem to invest in? C# a very new
> language has added the same -1 behavior, so obviously it does not cause
> major problems. While I support separate API for clarity, what justifies
> the expense(time and testing)?? One might not call this a technical debt
> issue, considering all the other users of this approach.
>
> Again just playing devil's advocate here.
>
> Thanks,
> Mark
>
>
>
> On Wed, Sep 6, 2017 at 3:26 PM, Anthony Baker <abaker@pivotal.io> wrote:
>
>> Perfect!
>>
>> > On Sep 6, 2017, at 3:13 PM, Jacob Barrett <jbarrett@pivotal.io> wrote:
>> >
>> > And this is where the details are more useful than the abstract. I
>> think if
>> > we focus more on specific API methods and answer the questions for each
>> or
>> > those we will spend less time going back and forth on the use of
>> sentinel
>> > values.
>> >
>> > X.doSomethingUntil(10s); <- do something, give up after at least 10s
>> > X.doSomething(); <- do something, never give up
>> >
>> > Very clear and no sentinel values.
>> >
>> > Y.doSomethingWithLimit(10); <- do it 10 times
>> > Y.doSomething(); <- do it forever
>> >
>> > Very clear and no sentinel values.
>> >
>> > -Jake
>> >
>> >
>> > On Wed, Sep 6, 2017 at 2:50 PM Anthony Baker <abaker@pivotal.io> wrote:
>> >
>> >>
>> >>> On Sep 6, 2017, at 2:29 PM, Jacob Barrett <jbarrett@pivotal.io>
>> wrote:
>> >>>
>> >>> Ok, I did not find that previous message at all clarifying but I did
>> find
>> >>> this one clarifying.
>> >>
>> >> I think the objective is to provide a clear and understandable API.
>> >>
>> >> IMO, a ReallyBigNumber is not easily readable.  Is the user’s intent to
>> >> wait XXX time or forever?  Why not provide a constant value / enum to
>> >> signal intent?
>> >>
>> >> There are so many usages of “0 as infinity” throughout the internets
>> that
>> >> I personally don’t find it all that confusing.
>> >>
>> >> Anthony
>> >>
>> >>
>>
>>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message