3 ms·
All the domain revolves around things moving around in the real world, there is no pixel. Also at some point, to prevent unit problems, someone tried to add me
by jffhn 4y ago
All the domain revolves around things moving around in the real world, there is no pixel.
Also at some point, to prevent unit problems, someone tried to add methods for units handling (set value and unit, get value for unit, or get value and unit separately), but it was a train wreck (people setting with fancy units, people getting the raw value assuming SI, and when unit was properly specified to the getter much time was spent in the object oriented and allocation addict units framework, and the code was bloated with units condiderations), so we got rid of that (which could surely be done better, but we thought it was just better without. We just have a few utility functions on the side for the rare cases where we need units conversions).
- wizofaus 4y agoThat says to me you should be using types with strongly-typed units built in (using templates/generics etc). I wouldn't expect to able to call "Set unit" on a quantity though, just a function to convert it and return the new differently typed quantity. Nor would you need "get unit" as it's known at compile time.