3 ms·
All these text-based serialization[1] formats are IMO relying on the same fallacies used to sell XML 15 years ago. Would you rather use XML for serialization,
by smitherfield 10y ago
All these text-based serialization[1] formats are IMO relying on the same fallacies used to sell XML 15 years ago.
Would you rather use XML for serialization, or an ad-hoc, undocumented binary format?
Er, XML I guess.
So it's proven: XML is better than binary formats! The golden age of XML is upon us!
[1] The specific task of serialization over a network; for configuration files or other applications involving direct manipulation by a human or a shell script, JSON or YAML (or XML) can be reasonable.
- wtetzner 10y ago> [1] The specific task of serialization over a network; for configuration files JSON or YAML (or XML) can be reasonable. I would argue that JSON is not reasonable for configuration files that are meant to be edited by humans, because they don't support comments. It's also annoying to write JSON by hand because all keys have to be quoted. YAML on the other hand, is a very nice configuration format.
- gmjosack 10y agoAlso the lack of trailing comma means often editing two lines to add new elements to lists or objects. I've actually experienced multiple outages at different companies where someone helpfully added a trailing comma to a JSON config.
- bandrami 10y agoMeh. XML is a subset of what you can do with s-expressions, with higher scanning and parsing overhead. Actually now that I say that it's pretty much true for any serialization format.
- athenot 10y agoExactly! While it's nice to have easy-to-read serialization formats when debugging, it strikes me as an attempt to come up with one format for both configuration and serialization. But the 2 have very different design objectives. Once we get over our fear of binary formats, there are some simple and generic ways to do serialization that can be used in any language, like Erlang's OSC[1], discussed on HN last year[2]. [1] http://joearms.github.io/2016/01/28/A-Badass-Way-To-Connect-Programs-Together.html http://joearms.github.io/2016/01/28/A-Badass-Way-To-Connect-... [2] https://news.ycombinator.com/item?id=10976737 https://news.ycombinator.com/item?id=10976737
- jcelerier 10y ago> Erlang's OSC Uh ? This is just some guy that used OSC in Erlang. OSC is used in many many many languages, mostly used in computer music and interactive arts : https://en.wikipedia.org/wiki/Open_Sound_Control https://en.wikipedia.org/wiki/Open_Sound_Control And guess what, it's honestly a pain as soon as you have a big application. Source: I'm developer of an OSC sequencer (http://www.i-score.org http://www.i-score.org) and a common complaint from artists with between 1000 and 20000 parameters in their OSC namespace is that it's absolutely unamanageable ; a lot of people are trying to add order, type systems, you name it, on OSC to bring some safety and documentability to the protocol.