So this seems like I should have been wondering about this when I first started programming, but I suppose back then I wasn't as concerned with 'perfect' variable naming.
So I have the variables
float lifeTime; float age;
Where lifeTime is the full lifeTime of my object, age the current lifeTime of the object. The object will die when age reaches the full lifeTime.
I was just creating a variable, ranging from 0 to 1, defining the progress of age compared to the full lifeTime. agePercent, if you will. Of course agePercent isn't correct though, as this ranges from 0 to 1.
After reading some other posts about ageFraction, ageGradient, ageNormalized, I felt like none of these fit the purpose.
My solution is agePerunum, simply using latin (I believe it's correct, but I dropped out in highschool). So my question is... is that cool? Does that make sense to you as a programmer? Any thoughts or maybe better ideas?
http://mymemory.translated.net/en/Latin/English/per-unum
Note that each Variable name is enclosed by percentage signs ('%'). The percentage sign is used as a special character; its most common use is to denote variables.
Nominal variables are often summarized as proportions or percentages.
A variable name must start with a letter or the underscore character. A variable name cannot start with a number. A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ ) Variable names are case-sensitive (age, Age and AGE are three different variables)
One idea is to make agePercent
equal to an actual percentage, so 37 instead of 0.37. But that might make other calculations in your code require an unnecessary conversion step.
Proportion and portion are nouns you could suffix age with. Proportion means the relation of one part to another or to the whole with respect to magnitude, quantity, or degree. Portion means an often limited part of a whole. So ageProportion
or agePortion
? First one sounds better.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With