4 ms·
What makes developers to lean towards YAML when JSON and JSON5 are more developer friendly? I personally hate YAML config files.
by realshadow 6y ago
What makes developers to lean towards YAML when JSON and JSON5 are more developer friendly?
I personally hate YAML config files.
- brown9-2 6y agoHow do you place comments in a a JSON file?
- realshadow 6y agoJSON5 does support comments
- verdverm 6y agoComments is one, and while JSON5 seems to support them, it does not look widely adopted or maintained. I do not like YamHell either, but prefer to JSON for readability I'm using Cuelang these days, Dhall is another option
- dpc_pw 6y agoThere's fundamentally no difference between them. They are both crappy tools for humans to write anything in and are better as a tools for machines to exchange data, which is accidentally human-readable in case debugging is neccessary.
- barrkel 6y agofoo: | bar baz This quote style in YAML is its best feature, IMO. It's not massively useful for k8s outside of config maps, but for other uses of YAML, it's great for embedding snippets of other languages that would otherwise need quoting.
- realshadow 6y agoKeeping up with indenion is a pain the ass when your config file is large
- barrkel 6y agoFolding and highlighting in the editor make it much easier. I use yafolding minor mode in Emacs, it folds based on indentation level, and it handles indentation-oriented syntaxes like Python and YAML as well as block-oriented syntaxes like C, Java, JS and Ruby. yaml-mode in Emacs highlights :| text in the quoted string highlight colour, so it's easy to see you're still in the block, or whether you've unindented your way out to the YAML again. I generally try and split out my yaml such that the quoted blocks don't need to be enormous, though. So, single SQL statements, rather than a whole SQL script, to take one motivating example. I also use highlight-indentation-current-column mode, for an extra visual aid.