I'm a programmer. I'm so sick of writing documentation for things that should be explainable in a word.
When you write a function in a programming language, you get to name its parameters. Most things I can name easy enough, such as "Name" or "URL" or "MaxSizeN". The first 2 are self explanatory, the last one is the maximum size of something in relevant data units(as opposed to bytes or some other unit) but that one is easily understood by other programmers too.
Very often though, there is a parameter that is a floating point type (float) that needs an input in the range of 0 to 1 (inclusive). This is problematic since I have no idea what to call those things so I have to write function descriptors (assuming the language has them) or document it some other way which is annoying.
Lets say this float needs to define the accuracy of something so I declare it:
function FuncName(float Accuracy)
This is very ambiguous since the type float itself can contain a ridiculously large variety of numbers. Meanwhile if I were to declare it as such:
function FuncName(float AccuracyPercent)
Then its immediately obvious that the input should be a value from 0 to 100.
Percentages aren't useful for math however, they are more like a "human friendly" markup for fractions and have no place in actual program logic and I'd rather avoid unnecessary overhead.
I'm looking for a word that I could mangle into my parameter names so that they would convey "this should be from 0 to 1".
I don't even care if the word is unknown to most people, I'll just start using it and tell others to read the dictionary :D
Is there any word for that?
float negExp. In scientific notation, you're talking about numbers with negative exponents. – stevesliva Sep 24 '15 at 04:09float) and then write validation functions to ensure that values of that type do indeed fall between 0 and 1? You will then add this type and its validation functions to a module of its own with the necessary documentation string. Wherever this type alias is used, readers can lookup its origin to understand the meaning. – Sridhar Ratnakumar Sep 26 '15 at 05:44accuracyFractionor anything with wordfraction. A programmer will know he can use 0 or 1 with that. -ve fractions will still be issue. Though you will need to put in boundary checks inside the function and throw/show descriptive errors anyway. – R.S. Dec 29 '15 at 12:35