On 03/29/2011 07:36 AM, Don wrote:
I'm a physicist and most of my programming involves quantities which
have units. Yet, I can't really imagine myself using a units library. A
few observations from my own code:
* For each dimension, choose a unit, and use it throughout the code. For
example, my code always uses mm because it's a natural size for the work
I do. Mixing (say) cm and m is always a design mistake. Scaling should
happen only at input and output, not in internal calculations. (So my
feeling is, that the value of a units library would come from keeping
track of dimension rather than scale).

Many of my bugs involving numeric code is that I mix scalars with units, not units of different scale.

Andrei

Reply via email to