Why is maxval a better name than MaximumValueUntilOverflow?
The first lacks some extra information that I need to keep in mind every time I re-read that part of the code.
And while the potential of overflow might be obvious, how about:
minValueForTemperature instead of minval?
Complex variable names ought to be avoided because, simply, they hammer the programmer with a bunch of information every time they are used. Usually, when reading code, you're trying to wrap your head around how a procedure operates rather than the specifics of what it's operating on. Often, if you need to know more about what a variable represents, it's sufficient to refer to its declaration.
Thusly, I prefer to name my variables so that one can pick up the general idea of what they're for from the name and then I document any additional information at the variable's declaration, either using a comment or via the type system.
So, this is how I'd handle your examples:
int maxval; /* until overflow */
Temperature minval;I'd also avoid putting prepositions into variable names, but that's just a personal preference for keeping things to one adjective plus one noun where possible (less parsing overhead for my brain).
If I need a longer variable name to clarify the intent of the code, it's a signal from the code that maybe I should break the routine into smaller pieces.
I also find that smaller variable names makes it way faster to scan and thus understand.
YMMV ...