3 ms·
You're currently being downvoted, but I agree, YAML is kinda terrible, not sure why anyone thought Python's syntactically relevant whitespace was ideal for a co
by EdwardDiego 6y ago
You're currently being downvoted, but I agree, YAML is kinda terrible, not sure why anyone thought Python's syntactically relevant whitespace was ideal for a config file.
Classic example:
- containerPort: 7173
name: http
I think that's an object in a list? But it's not overly clear.And if I indented any of those lines wrong...
- corty 6y agoalso, keywords of the underlying software mechanisms are decoupled, so uncheckable for plain YAML tooling. Whereas with XML you can at least infer a lot about the desired structure and keywords from the schema. Deeper checks are only possible with "real" programming languages, preferrably statically typed ones. I'm wondering when that wisdom trickles down to configuration languages.
- dmitriid 6y agoDon't forget the plethora of truthy values that put Javascript to shame. - country: NO Of course it's boolean
- riffraff 6y agothat was changed in YAML 1.2[0], which I think is many years old, but people don't specify a version on config files anyway and I'm not even sure most parsers respect it, so it keeps popping up, which is sad. [0] https://yaml.org/spec/1.2/spec.html#id2803629 https://yaml.org/spec/1.2/spec.html#id2803629
- dmitriid 6y agoThat's the problem with bad formats: they live forever. They and any number of parsers for any version between version 0 and now.
- pydry 6y ago>not sure why anyone thought Python's syntactically relevant whitespace was ideal for a config file. Because it reduces syntactic noise and increases informational density. Most other serialization formats end up putting in indentation anyway to make them readable (JSON, TOML).
- aliswe 6y agoThat's a map as a list element, iirc the terminology. But check out this. When studying the Yaml spec I discovered that a map property (key: value) can have not only a string as its key, but any value. Even a list. (cue screams)
- shahsyed 6y agoHere's another reason why YAML is bad: the fact that I have to read the spec to figure out what's going on. It should have been fairly simple to do this. Why do I have to know the difference between ":" and "=" ...?
- Already__Taken 6y agoWhy didn't anyone learn from CSS when we all made pre-processors like stylus, less and sass that added white-space sensitivity. It's not great. I thought HCL was one of the best attempts at a terse config language. Shortening foo { bar { bazz {} }} to foo bar baz{} cleans up plenty.