Re:Validating Kubernetes YAML for best practice and policies
by pydry on Sunday August 09, 2020 @10:36AM
(#24099887)
>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).
Re:Validating Kubernetes YAML for best practice and policies
by dmitriid on Sunday August 09, 2020 @10:21AM
(#24099814)
Don't forget the plethora of truthy values that put Javascript to shame.
- country: NO
Of course it's boolean
Re:Validating Kubernetes YAML for best practice and policies
by riffraff on Sunday August 09, 2020 @02:16PM
(#24101641)
that 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.
Re:Validating Kubernetes YAML for best practice and policies
by dmitriid on Monday August 10, 2020 @02:30AM
(#24106221)
That's the problem with bad formats: they live forever. They and any number of parsers for any version between version 0 and now.
Re:Validating Kubernetes YAML for best practice and policies
by aliswe on Sunday August 09, 2020 @10:58AM
(#24100010)
That'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)
Re:Validating Kubernetes YAML for best practice and policies
by shahsyed on Sunday August 09, 2020 @11:03AM
(#24100034)
Here'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 "=" ...?
Re:Validating Kubernetes YAML for best practice and policies
by Already__Taken on Sunday August 09, 2020 @11:58AM
(#24100440)
Why 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.
Re:Validating Kubernetes YAML for best practice and policies
by corty on Sunday August 09, 2020 @10:17AM
(#24099785)
also, 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.
Classic example:
I think that's an object in a list? But it's not overly clear.And if I indented any of those lines wrong...