[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOCS: Use actual TOML rather than a strawman #199

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ag-eitilt
Copy link

Your "What is wrong with TOML?" page has been coming up in a number of links for me recently, so the fact that the TOML example you use to illustrate why it's bad is so far removed from what any human would write is all the more egregious. I certainly don't mean to argue that TOML is perfect, but it's by no means nearly so bad as people would come away from that file thinking. So, I've edited the mechanical output from whatever tool you used to more accurately reflect what it would actually look like in practice.

As I say in the extended commit message, this still isn't the ideal showing for TOML given some decisions in the story schema, but I've also avoided using some tricks like inline tables which would have improved the comparison at the expense of readability. The key-as-human-readable-name is particularly impactful; by (properly) moving that to a machine-readable-but-human-friendly field under a machine-readable-but-human-friendly top-level key, the TOML drops another 0.5KB and becomes comparable in size to the YAML. Similarly, if I had left all the strings as the original single-line-with-\n, the file only came out to 74 lines total, but even with human-readable paragraphs and properly-broken error messages, it's still roughly equal LOC to the original TOML -- which shows how bloated the example was.

(Disclaimer: I personally disagree on every disadvantage you list except the syntax hierarchies -- and there I disagree even more strongly that Python is the example to follow. But I wouldn't hold anyone else to my views, and I recognize that what works for me really doesn't work for many others.)

The example file looks to have been machine-generated and (being generous) written to an old version of the standard, and does not present an accurate counter-example to the YAML.  This updates it to be (closer to) TOML as it might actually be written.

*Actual* actual TOML would very likely not include story/test names as the keys and instead simply something like `[map.variations.one-key]", with the full `"Mappings with defined keys (Map)"`, etc., names being defined as data-pairs within that, but I consider that a wart of the schema rather than of the language used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant