2 ms·
Sure, but this isn't a solution that's unique to statically-typed languages, and the syntax can get more awkward if you use a language without good OO support.
by verandaguy 5y ago
Sure, but this isn't a solution that's unique to statically-typed languages, and the syntax can get more awkward if you use a language without good OO support.
I also haven't come across a thorough implementation of unit conversions to do stuff like this (not that it's not a pattern that works -- I personally like this); it might be common in domains where dealing with real units is central to the business, but in industries where that's done incidentally, convenience classes like this just aren't around (in my experience).