> On 10 Mar 2017, at 23:32, Quincey Morris
> <[email protected]> wrote:
>
> On Mar 10, 2017, at 08:24 , Bryan Vines <[email protected]> wrote:
>>
>> Would integer division work better than the modulus operator?
>
> It would certainly work better in the sense that division is the right
> operator and modulus is the wrong one!
>
> Regarding the original question, I would add that there’s a decent argument
> to be made that keeping a long series of cases is clearer in intent and
> methodology than a concise but somewhat obscure calculation.
Of course.
switch(x){
case 0: return y;
case 1: y++; return y;
case 2: y++; y++; return y;
case 3: y++; y++; y++ ; return y;
…
}
this is much clearer in intent than return x+y. So much clearer…
--
__Pascal J. Bourguignon__
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]