When using numeric datatypes, all units have to be spelled out in documentation, variables, and function names.
Not only is this prone to human error, but it also requires significant boilerplate for what should be simple code.
/** * @param topSpeedMph miles per hour * @param floorItFeetPerSecondSquared feet per second squared */data classCar(valtopSpeedMph:Double,valfloorItFeetPerSecondSquared:Double){/** * @param targetMph the target speed in miles per hour * @return the time in seconds */funestimateAccelTimeSeconds(targetMph:Double)=// convert targetMph to ftps then divide by max accelerationtargetMph*1.46667/floorItFeetPerSecondSquared}
But, with units-of-measure, variables and functions are all documented by their type.
No more tedious documentation. No more massive variable names.
data classCar(valtopSpeed:Speed,valfloorIt:Acceleration){funestimateAccel(target:Speed):Time=target/floorIt}
Better IDE Autocomplete
Additionally, units-of-measure helps your IDE make more helpful autocomplete predictions.
If we were using only doubles, the IDE would just spit out every number in scope.