Re: Guidelines/checklist for reviewing code
- From: "J. F. Cornwall" <JCornwall@xxxxxxx>
- Date: Thu, 08 Jan 2009 23:22:58 -0600
Thomas Koenig wrote:
On 2009-01-08, J. F. Cornwall <JCornwall@xxxxxxx> wrote:
Which is a poor "rule" when your non-physics codes deal with things that are often not measured or computed in SI units...
When physics codes deal with electron mass and charge, non-SI
units make a lot of sense :-)
Or have to deal with many possible sets of units depending on who was doing the measurements, or who runs the instrumentation. We have a fairly small subset of data collected in metric units, but most water info in the US is in the traditional units (gallons, cubic ft/sec, ft/sec, etc).
*shudder*
Maybe not ideal, but it works... Most water work in the USA is done in these units, and there's a good long history of their usage, so as long as we're consistent its not a problem.
I remember seeing a liquid units conversion table in a control
room of a chemical plant in the US. This is plainly necessary
when you measure your tank size in cubic foot and your flows in
gallons per hour.
I would amend your "rule" to say that you should document the system(s) of units used in your code, and variable names should reflect the units as much as practical.
You'd probably need a module for unit conversion.
We have routines to do such conversions, but not a single module. Of course, we're still coding in 77-style because of other limitations. Having a number of conversion routines may not be ideal, but for our setup it's been working pretty well since before Fortran 77...
Jim
.
- Follow-Ups:
- References:
- Guidelines/checklist for reviewing code
- From: Arjen Markus
- Re: Guidelines/checklist for reviewing code
- From: fj
- Re: Guidelines/checklist for reviewing code
- From: J. F. Cornwall
- Re: Guidelines/checklist for reviewing code
- From: Thomas Koenig
- Guidelines/checklist for reviewing code
- Prev by Date: Re: Need modern version of old technique to show missing values
- Next by Date: Re: What is the value of pi?
- Previous by thread: Re: Guidelines/checklist for reviewing code
- Next by thread: Re: Guidelines/checklist for reviewing code
- Index(es):
Relevant Pages
|