Re: how to store list of varying types
"Tom Serface" <tom.nospam@camaswood.com> ha scritto nel messaggio
news:C3E60DCF-F8DD-4379-A9E6-830380189A5E@microsoft.com...
Why not just write out real XML? It makes it easier to test, read, and
even modify outside your program. You'd need a special routine to read
either type of file.
Hi Tom,
I agree with you that "real XML" is easier to test, read and modify, being a
text-based clear format.
However, I think that the main advantage of "tagged binary" [*] over "real
XML" is *efficiency*.
In fact, I believe that reading and writing (especially reading) in "tagged
binary" is much faster and consumes less memory than real XML.
(for example, in real XML you have to escape characters like < > &, etc.
parsing work is much more complicated, etc.
To manage XML it is better to use an external parser like TinyXML or
XMLLite, the latter being COM based, so not very easy... instead it is
trivial to write some C/C++ code to manage "tagged binary".)
[*] I used "tagged binary" in several times, I think it is very intuitive to
think about a format like that. I just did not know that name :)
Giovanni