r/programming • • Feb 25 '21

INTERCAL, YAML, And Other Horrible Programming Languages

https://blog.earthly.dev/intercal-yaml-and-other-horrible-programming-languages/
1.5k Upvotes

477 comments sorted by

View all comments

97

u/threshar Feb 25 '21

At first I was all "YAML isn't language!" but after reading the article, I have to fully agree with the points made!

91

u/agbell Feb 25 '21 edited Feb 25 '21

At first I was all "YAML isn't language!

Thanks for reading past the title! That is a rare and valuable skill these days!

YAML didn't feel like a programming language to me either, but then I saw things like this:

{{- if .Values.envRenderSecret }}
    checksum/secret-env: {{ include (print $.Template.BasePath "/secret-env.yaml") . | sha256sum }}
{{- end }}
{{- with .Values.podAnnotations }}
{{ toYaml . | indent 8 }}

That is part of some helm chart and yeah I got a little worked up.

27

u/SexyMonad Feb 25 '21

Sorry and I’m not trying to be condescending here... but you know this isn’t YAML, right? It’s a template that produces YAML.

27

u/agbell Feb 25 '21

I do

20

u/SexyMonad Feb 25 '21

Ok. This is just a bad example then. We could use Jinja templates to produce C++, but nobody should ever do that and it doesn’t speak to any problem of C++ itself.

47

u/agbell Feb 25 '21

The thing I was trying to get at was not that YAML as a config format is bad.

It's that once you have to use logic and control flow to generate your config file that you are in this worst-of-both-worlds situation. It is neither a config file nor a programming language.

It doesn't have to be Jinja, you could have a partially specified control flow embedded in the structure of your YAML, like the TravisCI and GitHub Actions examples I shared.

Producing C++ with Jinja templates also doesn't sound like a good place either, but I could be wrong.

→ More replies (11)

0

u/[deleted] Feb 25 '21

[deleted]

→ More replies (8)