4 ms·
Yes. YAML would be more verbose and require more precise (error-prone) syntax. See this thread: https://twitter.com/mbostock/status/1075135178014482432 https://
by mbostock 8y ago
Yes. YAML would be more verbose and require more precise (error-prone) syntax. See this thread: https://twitter.com/mbostock/status/1075135178014482432 https://twitter.com/mbostock/status/1075135178014482432
- blauditore 8y agoYou can write YAML much more concisely though: root parent foo: 1 bar: 1 Syntax details might be off from the top of my head, but the example in the tweet is a bit overblown.
- mbostock 8y agoThe thread I linked describes the limitations of the approach you suggest, in particular, the ability to associate metadata not just with leaf nodes but also internal nodes, and not requiring the names of children to be unique. Of course you can express hierarchies in YAML, but the result ends up being more verbose and more prone to syntax errors; the point of comma-separated trees is to be easier to read and edit.
- tracker1 8y agoI don't think comma separated trees are easier to read... in fact, I think they're quite a bit harder. I will say it might be easier to write. do string quoting, quote escaping and newline embedded in a quoted string work?