Description
It is not new feedback, but it was ignored again and again, then :number
was landed as "agreed".
Why :number
is not a good name for selection?
Let's try and see how readable this is (in a fictitious programming language), without reading documentation or registry.
switch( gender($foo) ) {
...
}
Pretty clear, takes the gender if $foo and decides on it.
switch( isPrime($foo) ) {
...
}
Again, pretty clear. Probably takes a number-like thing, and returns a boolean. Without reading the registry.
switch( even($foo) ) {
...
}
Again, pretty clear. Probably takes a number-like thing, and returns a boolean. Without reading the registry.
switch( number($foo) ) {
...
}
Again, pretty clear. Takes anything, tries to get a numeric value out of it (probably by parsing it?), and returns a number.
So I expect the keys (the case
s) to be numbers.
I have no reason to expect some kind of plural decision.
:number(foo)
vs :string(foo)
=> takes foo
and converts it to a number / string.
Because we have this:
switch( string($foo) ) {
...
}
which takes foo
and stringifies it, then make decision on the strings.
Python has str(foo)
, which stringifies, and num(foo)
, which parses foo
as a number.
Java has String.valueOf(obj)
, which stringifies the obj, and Integer.valueOf(str)
These are common operations, and similar ones can be found in other programming languages.
There is no programming language that has some kind of plural
operation on numeric values.
So it is not at all obvious that :number(foo)
means a plural decision.
If anything, it looks like parsing or casting.