W3C home > Mailing lists > Public > public-ddwg@w3.org > November 2007

RE: [API] Code snippet I .- fast property retrieval (not unit aware)

From: Rotan Hanrahan <rotan.hanrahan@mobileaware.com>
Date: Tue, 20 Nov 2007 11:19:21 -0000
Message-ID: <D5306DC72D165F488F56A9E43F2045D30160215E@FTO.mobileaware.com>
To: "Jo Rabin" <jrabin@mtld.mobi>, <public-ddwg@w3.org>

I was observing that toString() doesn't include a parameter to indicate
what units (if any) should apply when interpreting the returned string.
So I conclude that to interpret the string we should already know
something such as the default units, or know that no units apply.

So it boils down to how you know the units in advance. If you know (from
the vocabulary perhaps) that the physical width will be represented in
millimeters/millimeters, then that's good, because now the string
doesn't have to contain the units. If that is what you are suggesting,
then I'm happy with that. It means, of course, that we need to decide
where this a priori knowledge about the units will be represented. I
think perhaps the vocabulary might be a viable place. I'm hesitant to
suggest putting this in the ontology because the ontology his wider
applicability and we could not be certain that the default units we
choose would be the same as those chosen in other use cases.

This feels like an argument about angels on the head of a pin. I think
we're actually in agreement. The answer is 42, right?


=== original dialogue ===


> What is the justification for not including units in the string
> representation? Perhaps it would be the temptation to parse the string
> (which is definitely not something I would want to see). However, if
> application intends to display the strings to a human then there
should be
> some way to know a) if the human should be interpreting the string in
> units, and b) what those units are. So either we introduce the idea of
> default units for the toString() of any value to which units can
apply, or
> we include the units in the string. If I were to merely present
> "0.000000000001" as an output with no indication of what it means,
> what's the point? It's meaningless garble.

If I ask for the value in parsecs, then I expect the returned value in
parsecs. I know what the unit is before I get it back. If I am careless
enough not to represent that in user output, well, then I'm an idiot.
That's not the DDR's problem. If I am less careless, I may choose to
represent the unit in any way I like, especially for example, spelling
"millimetre" or "millimeter".


Received on Tuesday, 20 November 2007 11:19:36 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:00:15 UTC