Earlier quoted context omitted.
I think its because python has very strict and very simple indentation rules (a nested block must be indented, and the file requires consistent indentation. Is there anything else?) YAML gives you options, or varies necessity somewhat arbitrarily on the structures, which is (marginally) good for reading, but a lot of headache in writing
Also because the longer the YAML file, the bigger your indentation gets. It gets exponentially worse as you go.
Why are we templating YAML?
101–110 of 351 posts
Re: Why are we templating YAML?
#102Earlier quoted context omitted.
Baffles me. I don't like any language or file format where whitespace matters. Even Haskell bothers me in this regard. To me white space shouldn't add cognitive load. I want to look at the symbols not the formatting of the antisymbols to understand what is going on. Write JSON and use your editor tools to format it with nice indentation, and you are sweet! That said Yaml makes an excellent format for reading, but not…
> I don't like any language or file format where whitespace matters. .... To me white space shouldn't add cognitive load. 1. there is no language where whitespace does not matter 2. the very purpose of indentation is to ease cognitive load. Now, you may not want it to be inflexible or mandatory but your argument needs elucidating.
Re: Why are we templating YAML?
#103Earlier quoted context omitted.
Baffles me. I don't like any language or file format where whitespace matters. Even Haskell bothers me in this regard. To me white space shouldn't add cognitive load. I want to look at the symbols not the formatting of the antisymbols to understand what is going on. Write JSON and use your editor tools to format it with nice indentation, and you are sweet! That said Yaml makes an excellent format for reading, but not…
I never quite understood this attitude. Not treating whitespace as meaningful means it's necessary to have a longer, syntactically noisier file. That's fine if you're primarily concerned with computers exchanging data (JSON) but where readability and writability matters, extra syntactic weight is a headache. I can't imagine writing JSON by hand but I write plenty of YAML by hand every day without issues.
Re: Why are we templating YAML?
#104My belief is that we've been slowly building up to using general purpose languages, one small step at a time, throughout the infrastructure as code, DevOps, and SRE journeys this past 10 years. INI files, XML, JSON, and YAML aren't sufficiently expressive -- lacking for loops, conditionals, variable references, and any sort of abstraction -- so, of course, we add templates to it. But as the author (IMHO rightfully) p…
Thanks for plugging!
Re: Why are we templating YAML?
#105I saw this title and immediately knew the article would be about Helm. I don't think anyone wants to use Helm. People use it for a set-and-forget thing that they don't care about (who cares that it's called impressive-leopard-kubernetes-dashboard, after all.) kustomize is much more sane for your own stuff: https://github.com/kubernetes-sigs/kustomize It is actually a little bit too magical for my taste, but I continu…
Here is why everyone should use Helm:
Helm 2.0 introduced package as a first-class concept for Kubernetes and created the standard to distribute applications, thanks to Helm thousands of people could discover and collaborate on cloud-native deployments of the open source software https://github.com/helm/charts/tree/master/stable published and managed by organizations and contributors all over the world.
Helm 3.0 keeps innovating, it adopts the most forward-thinking approach to package management and Kubernetes config management by using higher level domain specific language based on Lua to create expressive package management system:
https://sweetcode.io/a-first-look-at-the-helm-3-plan/
Helm is also backed by CNCF[1] and is the best choice so far for organizations to create a reproducible CI/CD pipeline in a Kubernetes cluster.
Re: Why are we templating YAML?
#106Earlier quoted context omitted.
Came here to say similar. In particular dhall does allow scripting (functions etc.) but is non-Turing-complete as a feature. This seems like a particular sweet spot to me as it allows for more dynamism than data formats like json/yaml while constraining the scope sensibly. It also has very nice bindings with haskell and nix
also this is probably a nicer intro https://dhall-lang.org/
Re: Why are we templating YAML?
#107Earlier quoted context omitted.
Easier to read and write than JSON. JSON requires constant quoting, can't support multiline strings, has no comments, has no/little typing (e.g., no datetime type). It's not good if a human needs to encode data. For configs, I think TOML beats YAML hands down; I think YAML's spot is at encoding data structures that humans need to read/write. I do agree that YAML, the spec, is fairly complicated. But YAML, as used in…
It's worth giving Ansible some credit here. Alternatives like Chef, can and do contain arbitrary Ruby logic which can make Chef "cookbooks" horrible to figure out and debug. So while Ansible may not be great, other solutions also have drawbacks, and it isn't quite as easy as do .
Re: Why are we templating YAML?
#108Earlier quoted context omitted.
The killer feature for me over JSON is comment support, it's definitely useful to add todo comments etc.
Yeah this is a huge selling point of YAML. JSON should have comments added to the spec. The other benefit to YAML is human readability, which is usually better in YAML compared to JSON. A specific glaring example of this is when there are long string-literal snippets inside the document, in YAML this is massively more readable than in JSON.
Re: Why are we templating YAML?
#109Earlier quoted context omitted.
> If you have been around long enough you still remember the world that was excited about XML and templating it using XSLT. As a hindsight it was a horrible world. I actually really like the idea behind XSLT: machine-friendly, human-tolerable, structured data + declarative rules for turning that data into a display, or a report, or whatever else. The execution was horrible though: incredibly verbose, lots of overcomp…
XSLT was one in a litany of domain specific languages (ant, apache rewrite rules, latex macros, etc.) that evolved towards turing completeness because that's what the problem space demanded. In most if not all of these cases an existing and well designed turing complete programming language would likely have better served them.
Re: Why are we templating YAML?
#110Why template yaml when you could just generate it? Or generate json, or toml, or xml, or environment variables...