News for hackers. Stuff that matters.
Re:One Way to Represent Things by gampleman on Friday February 26, 2021 @05:06AM (#26273176)
I'd just like to point out some examples of things that are implemented incompatibly commonly, not because they are different:

Colors:

    (r{0.0-255.0}, g{0.0-255.0}, b{0.0-255.0}, a{0.0-255.0})
vs

    { red = r{0.0-1.0}, green = g{0.0-1.0}, blue={0.0-1.0}, opacity = o{0.0-1.0} }
That is tuple vs record, different scaling factor, opacity vs transparency, but these representations are equivalent.

Or geopoint:

    (lat, lng)
vs

    (lng, lat)
I could go on...
Re:One Way to Represent Things by jacobolus on Friday February 26, 2021 @06:17AM (#26273617)
Re:One Way to Represent Things by gampleman on Friday February 26, 2021 @06:37AM (#26273740)
If transfer size isn't an (important) consideration, then the one true answer is: just use a record, which doesn't enforce an ordering and is explicit about which coordinate is which.
Re:One Way to Represent Things by Quekid5 on Friday February 26, 2021 @06:10PM (#26280949)
The color ones are not (unambiguously) equivalent, you're ignoring bit depth and assuming 8-bit color values in one of them.
Re:One Way to Represent Things by gampleman on Monday March 01, 2021 @06:20AM (#26301665)
I am not, both are floats. They are represented only in that range, because that's customary in web dev circles.
Re:One Way to Represent Things by Quekid5 on Tuesday March 02, 2021 @11:45PM (#26324865)
Floats? What does R=255.0, etc. mean when the other example has R=1.0?

Precision has nothing to do with it, the scale isn't even defined... which was my point.