4 ms·
I would actually call this a bit of an antipattern. `accuracy` seems fine to me -- although a more descriptive function name than `FuncName` might suggest a be
by donw 6y ago
I would actually call this a bit of an antipattern.
`accuracy` seems fine to me -- although a more descriptive function name than `FuncName` might suggest a better parameter name as well.
Digging through the dictionary to find the perfect word means that whoever reads this code is likely going to have to do the same -- why would you ask them to do that?
If you aren't referring to a common mathematical or physical concept, and the word you need it isn't a part of your domain language, you're better off with "accurate but slightly vague" over "almost precise" or "precise but obscure".
It seems like the author's need would be better met by readable tests, guard conditions, and -- if this is part of an API -- documentation that describes how `accuracy` is used.
- nicky0 6y agoYou're not wrong but it would be nice to have a word for this incredibly common type of value still.
- donw 6y agoAs a mathematician, I heartily agree.
- V-2 6y agoI couldn't agree more. If you can't express it using the features of the language itself (custom domain-specific type, compile contracts?), limit yourself to putting this info into the docs, but keep naming simple. Don't come up with fancy names. One of the commenters already declared (jokingly??) they'd "call it PropUnity, for proportion of unity, unity being 1". Holy smokes Batman. As a code maintainer, I imagine encountering "accuracy" (even though it isn't fully accurately named itself) would confuse me somewhat less than "propUnity".