Re: Autoboxing and Performance ?
Martin Gregorie wrote:
Stefan Ram wrote:
Moreover, a lenght (in physics) /does not have/ a unit!
As a chemistry graduate I disagree quite strongly with that. Its quite
impossible to calculate anything without knowing the units the givens
were measured in. I seem to recall a certain NASA Mars probe failing
because the units used to measure fuel remaining were unstated. As a
result somebody calculated burns wrongly by confusing lbs and kg, causing
the probe to run out of fuel and miss Mars entirely.
If read carefully, he didn't say the unit shouldn't be known, only that that knowledge
should be prior to run-time.
A certain Mars probe would have landed if that unit were properly communicated by
memo. It need not have been encoded in the computer.
You are correct that the problem was that the unit was unstated. That is not at issue.
What is at issue is where that statement should be made.
For example, there is a certain distance from the sun to the Procyon,
what is the unit of that lenght? As a physical value, it has no unit!
Only when one wants to write it down, one has to choose a certain unit
system and number system, and one can choose every unit system one
likes. This is an artefact of our notation, not a property of the
length.
If you don't know the units the measurement was made in, its a
meaningless number that can't be used to calculate a valid result any
Again, it is not in dispute that the unit is needed for communication.
more than you can add "not very far" to "a huge distance" and get a
measurable distance.
And yet again, measurement of a distance does require a unit. It is distance
itself that does not.
I didn't read any post here that attempts to refute the necessity of units for
calculation and communication.
I do read two positions, one that the unit should be communicated out of band
and the other that it should be encoded in the software.
Like all engineering decisions, the choice depends on the need of the system at
hand. Each has features that render it more optimal for some scenarios and less
for others.
--
Lew