|
![](/i/fill.gif) |
In article <405cdbae@news.povray.org>, Darren New <dne### [at] san rr com>
wrote:
> Christopher James Huff wrote:
> > Because it's harder to read and write binary data in a portable way.
>
> No it's not.
Hmm...yes it is. To write "1.5" in a portable way in text only requires
writing those three characters. In binary you need to write it byte by
byte in a known floating point format and byte ordering, regardless of
what the native machine format is.
> I'd even go so far as to bet there are more uses of
> portable binary formats than portable text-based formats, once you get
> off the internet.
They certainly are more useful, but that doesn/t make them any easier to
read and write.
> Try ASN.1, for example. And I only know of two image
> formats that aren't binary, and neither is designed to be read by a
> person, yet all are quite portable. You just have to specify stuff like
> the order and size of multi-byte integers.
You forget floating point values, but even multi-byte integers involve
more complexity than text format integers.
> Anyway, XML *is* a binary format. It's UTF-8 by default.
UTF-8 is an encoding for text. XML is text. You can't directly write a
binary floating point value in it, for example...you have to convert it
to a human-readable textual form, even if it'll never be seen by humans.
This is trivial to do with the standard C or C++ libraries, but there
are no standard ways to portably write multi-byte integers or floating
point values. You have to write all that stuff yourself.
> > I thought it sounded great...up until that last part.
>
> Or, as I saw someone say elsewhere, XML is a hammer looking for a
> nail... and finding fingers.
Sounds appropriate.
--
Christopher James Huff <cja### [at] earthlink net>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tag povray org>
http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |