Hacker News new | ask | show | jobs
by shean_massey 2110 days ago
I had tons of headaches trying to get toml to do what's trivial in Json (nested arrays of objects of arrays of ... etc). 1/10 would not try again. For very simple, hear "flat" config it checks out. But then, so does yaml or even ini files. Anything requiring composite types was just a nightmare. I'd even prefer xlm before using toml again.
2 comments

toml really is best for mostly flat data. when your config grows more complex than that, i recommended you break it into multiple files and use directory structures or filenames to convey their relationship. or, of course, switch to a configuration format that is more well suited to deeply-nested data.

your comparison to yaml or ini is apt; toml's strength over yaml is syntax simplicity and toml is more-or-less a superset of ini (which itself is poorly-defined).

I never had to work with it seriously but I still don't get why people hate XML so much.
XML is verbose, surprisingly complex, and first and foremost not designed to be written and consumed by humans.

There's plenty of room for debate, e.g. element versus attribute and things get unwieldy pretty quickly [1]

The "note"-example illustrates the issue quite well: the order of the elements matters and you end up writing every element identifier twice.

Not to mention the bloat that comes with using an XML library that's actually compliant with the standard and includes all the bells 'n whistles.

[1] https://www.w3schools.com/XML/xml_dtd_el_vs_attr.asp

I would venture a guess that on the surface, it's about its verbosity and the pyramids of doom you can get when editing.

On a deeper level, I think they might be frustrated with the ability to develop custom formats (XSDs) which effectively make XML not one format, but a gazillion formats.

I think it allows too much and parsing it becomes a burden.

with json - you just suck it all into your data structure

with xml - sometimes people put stuff as a tag, sometimes as an attribute. Maybe not you, but someone else will do it.

Hipster meme that only xml has problems. Ironically they now went full circle to yaml, which is much more obtuse than xml.
Personally I find it a lot less readable than things like JSON or TOML.