Skip to content
This repository has been archived by the owner on Mar 19, 2018. It is now read-only.

should requireCancelable be an enum? #7

Closed
RByers opened this issue Jul 3, 2015 · 2 comments
Closed

should requireCancelable be an enum? #7

RByers opened this issue Jul 3, 2015 · 2 comments
Labels

Comments

@RByers
Copy link
Member

RByers commented Jul 3, 2015

@tdresser commented on the definition of requireCancelable:

Is there precedent for null being used to indicate the default value in APIs like this? Would an enum be clearer?

I'm not sure. I have a mild preference for boolean since this is really a 2-state switch. Another option might be to make it an optional member of the dictionary that's a simple boolean, rather than supporting an explicit 3rd value.

@tdresser
Copy link
Collaborator

tdresser commented Jul 3, 2015

I think it's somewhat more natural to use an optional boolean, and use lack of presence in the dictionary to indicate default behavior, instead of null.

I think an enum might be clearer though.

@RByers
Copy link
Member Author

RByers commented Jul 3, 2015

Irrelevant as of #9

@RByers RByers closed this as completed Jul 3, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants