Why all use binary files, if all can use XML ?
Because of performance, of course, then XML is good when you have to define a tree structure but not all kind of data fits well with it. Would you store a 3d model inside a XML file? Or an image?
XML is good to handle text data, what about effective binary data like images, sounds, compressed files, whatever..
It's really verbose and heavy to be parsed and you don't want to use it when performance matters (think about the netcode of a game for example).
I would shoot myself if I have to read an XML file containing for example structures for vectors or points.
Using a parser instead that dumping content into memory with something like:
fread(&myBuf, sizeof(vector_struct), 10, in);
would make me feel stupid..
Have you seen XML? It appears to be an insidious scheme by hardware manufacturers to sell larger hard disks :-)
However, humour aside, I would choose to use binary files if:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With