quilt-mappings icon indicating copy to clipboard operation
quilt-mappings copied to clipboard

Clarify conventions around `calc`, `calculate`, and `compute`

Open OroArmor opened this issue 3 years ago • 5 comments

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.

OroArmor avatar Feb 25 '22 20:02 OroArmor

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 avatar Feb 26 '22 06:02 Jamalam360

@Jamalam360 I think think this in response to part of my review of #90

supersaiyansubtlety avatar Feb 26 '22 10:02 supersaiyansubtlety

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.

supersaiyansubtlety avatar Feb 26 '22 10:02 supersaiyansubtlety

Then yes I'd say calculate

Jamalam360 avatar Feb 26 '22 10:02 Jamalam360

I like the idea of using compute as shorthand for an impure calculation, while calc implies a calculation where nothing is mutated

ix0rai avatar Nov 20 '22 04:11 ix0rai