Re:Why the fuck are we templating YAML? (2019)
by mark_and_sweep on Tuesday January 23, 2024 @07:50AM
(#39102677)
Agreed, and I almost feel silly for pointing this out, but for writing JSON (JavaScript Object Notation), I'd recommend using JavaScript...
[ Parent
| on HN ]
Re:Why the fuck are we templating YAML? (2019)
by jeroenhd on Tuesday January 23, 2024 @08:02AM
(#39102798)
For JSON I'd stick with Typescript to be honest. You end up executing Javascript and producing Javascript-native objects, but the typing in Typescript to ensure the objects you produce are actually valid will save a lot of debugging.
Re:Why the fuck are we templating YAML? (2019)
by Draiken on Tuesday January 23, 2024 @08:36AM
(#39103108)
JS is actually not that great for this IMO. You probably need an NPM package to even deal with YAML because JS has a shitty standard library.
Sticking to a scripting language with a strong standard library is way better.
Any unix system can get Ruby/Python and read/write YAML/JSON immediately without caring too much about versions.
Of course in today's upside down world most developers seem to only know JS, so it would at least be "familiar". Still a bad choice in my view.
The way this industry is going, give it a few years and we'll have React-Kubernetes for generating templates. And I wish I was joking.
Re:Why the fuck are we templating YAML? (2019)
by mark_and_sweep on Tuesday January 23, 2024 @12:17PM
(#39106298)
Parent is talking specifically about writing JSON, not YAML.
Re:Why the fuck are we templating YAML? (2019)
by Draiken on Tuesday January 23, 2024 @02:04PM
(#39108018)
Yeah, but the article is about YAML and my original comment was about configuration in multiple formats.
So, to clarify, for JSON JS is definitely not the worse option. For me though, even for JSON, you have much better options.