-
Notifications
You must be signed in to change notification settings - Fork 385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider a more commonly-known word than "arity" #1893
Comments
What about public readonly struct ArgumentValueCount : IEquatable<ArgumentValueCount> {
// ...
} public abstract class Argument {
public ArgumentValueCount ValueCount { get; set; }
// ...
} public static readonly Argument<FileSystemInfo?> Target = new("target") {
ValueCount = ArgumentValueCount.ZeroOrOne
}; |
Was discussed in #2046 but not decided. |
Given that |
I just stumbled upon this issue when checking the API changes (listed in #1891). Since it's open for discussion, I'd like to support the opinion to keep using the term "arity". While this term might not be recognized by many developers (for example by folks who don't have formal mathematical or computer science education), it expresses the entity exactly (see Arity on Wikipedia for reference) and makes perfect sense to people familiar with the term. Another benefit of using the proper formal term "arity" rather than an approximation is also an educational effect. It expands people's knowledge ("Oh, that's how this thing is called!") and helps to coin the right terminology which in turn results in better understanding between developers. |
After reading through #2046 , I'm happy to have a dedicated space (here) to discuss this. I'm afraid I don't have a perfect answer to this question (I suggest a few "less than ideal" possibilities in #2292) , but I very much appreciate the discussion. I don't think anyone refutes the "correctness" of the term Arity. It's more a problem of "discoverability". By sharing some of the story of how I came to "discover" this property (below), I hope to raise some awareness on the importance of choosing terminology that is "ubiquitous" (any DDD fans?) across the developer community.
If I hadn't discovered a bug, cared enough to dig deeply into the source written a github issue, and gotten lucky when a contibutor responded and "happened" to mention a term I'd never heard before in their response, it's very possible I never would have discovered this property. I'm also not a fan of the term Cardinality (discussed in the other thread) for the same reasons. This term I've heard of, but not often enough to memorize the definition. Until I looked at the possible values for Arity, I also did not realize that a single argument accepting multiple values was even a possibility (nor do I fully understand the use case or how that would look in example commands). Would it be something like this (where pepperoni, sausage, ham are modeled as a single argument with Arity = ZeroOrMore)? Can someone help with a real-world example of when this is used?
|
Parsing similar to ZeroOrMore is usual in Unix utilities that take a list of file names, e.g. cat or ls; it works nicely together with wildcard expansion (globbing) in the shell. Typically though, if the list is empty, then each utility uses some default value instead: |
No description provided.
The text was updated successfully, but these errors were encountered: