3 ms·
Your comparison of data vs. messages is interesting, although I think what you really should contrast is messages/data vs. markup. HTML and LaTeX are clearly m
by strags 15y ago
Your comparison of data vs. messages is interesting, although I think what you really should contrast is messages/data vs. markup.
HTML and LaTeX are clearly markup languages (or "code"). It's entirely reasonable to expect somebody to edit HTML and LaTeX in a plain old text editor. Totally agree with you on this.
Where I disagree, however: The OmniGraffle file in the article, isn't code - it's a serialization of an internal data structure. The primary method for editing this data is not a text editor, nor should it be. While it's cool (I guess) that the author was able to hack around inside it, I don't think XML is a good choice here, for the reasons I described earlier. Nor do I think it's a good choice for most object serializations (including both transient messages, and persistent data).
Now, the OmniGraffle file in question is pretty simple, so you could argue that maybe XML isn't so terrible. But, consider cases like http://en.wikipedia.org/wiki/COLLADA http://en.wikipedia.org/wiki/COLLADA . Storing 3d object vertex data in XML is, if you ask me, insane. If you have an object with tens of thousands of vertices, you will never edit this file by hand. What is XML gaining anybody here? Yay - you can use an off-the-shelf XML parser! But you then have to copy XML's graph into your own vertex structures in order to do anything useful! So, you really haven't gained anything except vastly increased memory and CPU usage.
See http://collada.org/public_forum/viewtopic.php?f=12&t=25&start=0 http://collada.org/public_forum/viewtopic.php?f=12&t=25&... for some discussion on this.
- bo1024 15y agoCool info, and thanks for the links! I agree about XML. I think one reason XML is annoying is that it lives in both worlds -- human-readable, but able to encode arbitrary machine structure. But with OmniGraffle, for example, it seems like XML is a suboptimal choice because you shouldn't need all that XML structure getting in the way -- if you know what data to put where in the document, why throw all these tags around it? So like you say, XML's main advantage seems to be that you can use an off-the-shelf parser; but it doesn't really seem worth it. However, I still think plain text can be a good choice, I just would be less afraid to define my own specification. But I feel like I would rather use an extreme -- binary data (which would require custom serialization) or plain text (which would require custom parsing) -- over something general-purpose and verbose. Disclaimer: I am not a professional software engineer and do not have experience with large systems. My opinion might change after I got my hands dirty.
- ajuc 15y agoThere's no excuse for XML - sexps and json are just as general as XML, and much less verbose.