quilt-mappings
quilt-mappings copied to clipboard
Clarify conventions around `calc`, `calculate`, and `compute`
Java uses compute in maps to store a value after generating it. A quick search of the Java 17 Docs has one result for calc, with around 20 - 30 being calculate. Discuss.
What context is this in, i.e. do you have an example method that the result of this discussion will be applied to? I think calculate or compute.
@Jamalam360 I think think this in response to part of my review of #90
Based on the use of compute in maps, perhaps compute could imply that something is calculated and then stored in some way, where as calculate could imply something is calculated without any mutations or side effects.
As for calc versus calculate: calc has brevity, and is such a recognizable abbreviation (for me, and in the context of method names), that it makes things slightly more readable.
Then yes I'd say calculate
I like the idea of using compute as shorthand for an impure calculation, while calc implies a calculation where nothing is mutated