Those are just types. You shouldn't write types in the names. That's just redundant. If you need to check the type of a variable, hover over it and your IDE should tell you that temperatureThreshold
is type DegreesCelsius
. No need to add extra cruft.
This is especially problematic if you later refactor things. If you change units, then you have to rename every variable. If you overload variables, it doesn't make any sense.
Plus, variables shouldn't really be tied to a specific unit. If you need to display in Fahrenheit, you ideally just pass temperatureThreshold
and it converts types as needed. A Temperature
type that that has degreesF()
and degreesC()
functions is even cleaner. Units should just be private to the type's struct.