Are there any Hungarian-in-spirit style guides for appending (SI or Imperial) units to variable names for physics-intensive C/C++? I'd expected that this wheel had already been invented, but online I found only simple examples like duration_sec
and length_ft
. (No boost, please.) (Roughly related: naming of physical quantities in python .)
Typeset prose has a good style guide, but its superscripts, slashes and italics fail in programming languages.
I'd even be happy with arguments resolving particular issues that arise with compound units like spectral radiance, moment, torque, or energy:
- plural or not (lbs, lb)
- capital or not (Lb, lb)
- reciprocals (PerSec, pSec, SecInv)
- superscripts like cubed or inverse squared