Quick poll: gmean or geometric_mean

Ian Kelly ian.g.kelly at gmail.com
Sun Jul 10 13:15:59 EDT 2016


On Sun, Jul 10, 2016 at 9:03 AM, Marko Rauhamaa <marko at pacujo.net> wrote:
> Ian Kelly <ian.g.kelly at gmail.com>:
>
>> That's still excessive by any reasonable standards. Names should be
>> descriptive, but no more verbose than necessary. How about:
>>
>> force_N = -G * mass1_kg * mass2_kg / distance_m ** 2
>
> Why bother with tagging the names with standard units?

The point of the example was to demonstrate descriptive names. For
local variables I usually wouldn't bother with the units, but in
general it's a good practice to help avoid crashing your orbiter into
Mars.

> Shouldn't it be G_N_m2_per_kg2, given your strategy for identifying the
> units associated with the other variables?

To me, the use of the standard name implies standard units, so no, "G"
is sufficient. YMMV.



More information about the Python-list mailing list