3 ms·
Yes, SI base, for example second, not powers of tens of it, but we just call it SI. For linear positions no suffix means meters (x, y, z, etc.), same vx is in m
by jffhn 4y ago
Yes, SI base, for example second, not powers of tens of it, but we just call it SI. For linear positions no suffix means meters (x, y, z, etc.), same vx is in m/s etc.
Autocomplete is nice but in my IDE it requires hitting ctrl+space and then you might have a choice to make.
- wizofaus 4y agoLinear positions with no suffix I'd typically assume were in pixels! Or just unitless cartesian positions.
- jffhn 4y agoAll 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.