4 ms·
I have minimal experience with YAML (100% of which configuring for CI environments because apparently that's what all the modern ones prefer). I don't really kn
by eyelidlessness 10y ago
I have minimal experience with YAML (100% of which configuring for CI environments because apparently that's what all the modern ones prefer). I don't really know the ins and outs of the format, and try to stick to extremely simple representations.
Today I learned that what I perceived as somewhat complicated syntax is actually overwhelmingly complex.
I know that my preference for s-expressions is not shared by everyone, but the more complex a syntax I encounter, the more I wonder if simpler alternatives were even considered.
Genuine question: apart from inertia, and apart from recursive references (noted in comments before I wrote this), is there a use case for YAML that isn't solved by simpler and less ambiguous formats like EDN or Transit?
- jaredklewis 10y agoJust one data point, but I had never heard of transit or edn before today. Both look awesome. On the other hand I picked up YAML in less than a day (many years ago) and despite its complexity can't remember that ever causing me any issues. Not 100% sure if missing from your suggested formats (which do support multi line strings) but I enjoy use of yaml's folded strings.
- fibo 10y agoYAML was the first human readable/writable format, so better t'han XML and JSON for us humans. Also is a superset of JSON.
- Someone 10y agoHuman writable? I have little experience with it, but if what Amazon uses for its CodeDeploy configuration files is representative for the format, I disagree. IMO, a human writable format shouldn't need a help page like this: http://docs.aws.amazon.com/codedeploy/latest/userguide/app-spec-ref-spacing.html http://docs.aws.amazon.com/codedeploy/latest/userguide/app-s... Yes, part of that is CodeDeploy, but saying "tab characters must not be used in indentation" for me, disqualifies a standard as "human writable". CodeDeploy makes that horrendous by requiring five or so clicks to figure out what causes an error (try forgetting adding an app spec.yml file or saving a file with a BOM)
- tooFastFuckYou 10y agoYes, the no-tabs thing is backward as hell. If this format is based on indentation, how does the parser deal with not knowing whether the writer used two or four spaces per level? And what if the parser encounters three spaces? Tabs would be totally unambiguous: each tab is the next level. The "official" explanation is useless; there's not a single example of what problems are caused by these alleged differences in how editors handle tabs.
- mst 10y agoIt's an indentation-is-semantic format. I've had more trouble with things trying to allow both spaces and tabs than I've had with YAML's refusal to allow tabs.
- stubish 10y agoI think all the cited bugs I'd also fail in a code review. YAML is great, provided you pretend most of the spec doesn't exist and treat it as JSON with some syntactic sugar. I don't ever want to see !! even in output for machines. The big problem is when the useless features that you should, never, ever use (and if you do you are doing it wrong) bite you on the arse. Because it tried to do too much, like XML, even when we knew that was a bad idea. But is is still the best 'JSON with better layout' out there, which is what we want when we want readable documents and maintainable code. EDN, Transit and TOML all fail in that somewhere, IMO, and of course popularity is actually a hugely important feature for any data interchange format.
- mst 10y agoYAML is designed for machines to write, and only incidentally for humans to read. If you want a configuration format, ingy and I designed JSONY for that.