I love JSON so much that I can interpret the descriptions of fields myself. I don’t need YAML to tell me this is an integer. I know YAML is the schema format but god I hate to look at a YAML.
Comments don't belong in message exchange formats. JSON is not suitable and not was meant for configs. They do different things and if you use it incorrectly, it's your fault.
Good news, YAML is a superset of JSON, so you can write JSON in YAML documents! In fact, you can mix them in the same document, depending on the parser.
"Let's release a new version with breaks backwards compatibility, lets make sure there is no way to figure out which version is required to parse the document" seems more like a spec issue.
Using Version 1.2 instead of a mahor version bump is a bummer for that as well.
Python is a programming language with ergonomic features to reduce the need for deep nesting. So the white space is never a huge issue.
YAML is data format so deep nesting is pretty much unavoidable. I have had to maintain several YAML files where I got instantaneous vertigo for the amount of white space levels.
What are your workflows that require such deep levels of indentation? I’ve worked with Ansible, Kubernetes, Docker Compose, Airflow, Prefect, and I’ve never had that problem
Implicit type conversion issues such as the Norway problem
Syntatically meaningful whitespace
Enormous, complicated grammar
No thanks. JSON for computers talking to computers, JSON5 for configuration written by human beings. ESM if you're already writing in JavaScript/TypeScript and the config is potentially complex.
genuinely. the more I hear about YAML, the more I hate it. It seems to be the Embodiment of everything I personally hate about certain programming languages, jammed together.
I think it's funny that JSON has no implicit type conversion, but was derived from JavaScript, a language that does and is often criticized for it. And then somebody with the stink of death about him thinks, "Let's put implicit type conversion back in, and throw in Python's syntactically-meaningful whitespace while we're at it" and invents YAML.
We have much better interchange formats when you control both ends of the conversation.
Agreed. I was mostly referring to when you don't control both ends.
Which usually means that you pre-process the comments out, or you pass it through a YAML decoder because JSON5 is valid YAML. Just use toml.
I disagree with your assertion that JSON5 is valid YAML (comment styles; `\n` within single-quoted strings; incompatibilities with hex numbers, unary `+` operators, multiline strings with escaped newlines). But I do agree that TOML is good.
JSON should absolutely not be the top choice for computer-to-computer data transfer. JSON wastes a ton of space and incurs far more serializing/parsing time for the sake of human readability.
YAML is worse at doing the things that YAML is meant to be good at (specifying a set of configuration values) than TOML is.
And YAML is worse at the things JSON is meant to be good at (storage and serialization) even when you abuse the fact that YAML is a superset of JSON.
The YAML spec also has a lot of stuff in it. This means there are very few implementations, basically only 1 primary one. But most of that stuff is not used by anyone, and some of it causes some unintended side effects.
YAML has gotten to be pretty hard to justify. Pun indented.
Great for readability and human friendly. Less efficient for storage, transmission, machine reading and writing.
Edit: I actually really really like YAML and use it a lot where appropriate, but it's designed for a specific usecase, and not to replace JSON everywhere.
I'm with you on the eyesight thing. I don't know if it's just the editor or what. I've taken to using Geany so I can see it better for what it's worth.
Yml’s such a dumb format. It’s completely unreadable once something has a lot of nesting. But if something doesn’t have a lot of nesting, it’s no more readable than json. I blame Ruby devs
You need to train your eyes by learning Python in notepad.exe when you are 11 years old. If you are past this then it is too late, you will never know the joy of whitespace-programming.
I will admit my only (so far?) use of YAML is with personal projects like Home Assistant (maybe MagicMirror was YAML too?). I mean I don't hate it. I mean now that I have made basically what I want and I can copy and paste the bits I need. Alignment does give me trouble sometimes and I'm not used to the way code is validated.
I've taken to using Geany to help me see everything better.
That and dynamic typing makes me avoid python as much as possible. I know that Pyright exists, but it feels like a bandaid solution similar to Typescript
I'm a big proponent for simple formats like ini for config and simple data. You can write a parser in about 20 minutes, and there's no reason you should have to do a whole load of JSON when all you need to do is match key value pairs. Easier to write, easier to read, easier for computer to parse
XML is pretty good for structured documents (like websites) as it separates tags and attributes, which JSON does not, but on the other hand it sucks for configs because it separates tags and attributes.
Maybe i'm crazy but I dislike yaml. or indentation in general to 'define context' (for the lack of a better description). just use a wrapper character instead and leave the formatting to me.
Yaml is not turing complete. People writing yamls and calling them "automations" or "ansible playbooks" are the worst. You wanna automate something, go use a real programming language, like shellscript or something
Umm.. YAML is not good due to so many footguns (eg. "NO" silently becomes False, risk of remote code execution). I only use it when a tool requires it.
I only use YAML when I'm forced to. Fuck that shit. The amount of times I've been bit by a single space being off or forgetting how THIS version of YAML is supposed to handle collections. Fuck that mess! JSON 4 LIFE.
it's not that much easier to read if you print out your json on multiple lines lol. I would say it's easier to write which is why it's nice for a config or smth you might wanna edit by hand lmao
1.3k
u/ClipboardCopyPaste 2d ago •
JSON slander will not be tolerated.
1.5k
u/anzu3278 2d ago
Any language where whitespace is syntax can go die in a hole
316
u/rjwut 2d ago
Heck no, YAML can go suck an egg.
No thanks. JSON for computers talking to computers, JSON5 for configuration written by human beings. ESM if you're already writing in JavaScript/TypeScript and the config is potentially complex.
130
u/GrimReaper2601 2d ago
YAML looking down on JSON until someone accidentally presses the spacebar 3 times instead of 2.
66
u/seniorsassycat 2d ago
No
27
u/no_brains101 2d ago edited 2d ago
nah.
YAML is worse at doing the things that YAML is meant to be good at (specifying a set of configuration values) than TOML is.
And YAML is worse at the things JSON is meant to be good at (storage and serialization) even when you abuse the fact that YAML is a superset of JSON.
The YAML spec also has a lot of stuff in it. This means there are very few implementations, basically only 1 primary one. But most of that stuff is not used by anyone, and some of it causes some unintended side effects.
YAML has gotten to be pretty hard to justify. Pun indented.
49
u/suvlub 2d ago
Imagine a format so messy it can't even figure out what it is, Mr. "Yet Another Markup Language Ain't Markup Language"
284
u/Fast-Visual 2d ago edited 2d ago
Great for readability and human friendly. Less efficient for storage, transmission, machine reading and writing.
Edit: I actually really really like YAML and use it a lot where appropriate, but it's designed for a specific usecase, and not to replace JSON everywhere.
38
u/Scientific_Artist444 2d ago
TOML looking at YAML:
I have just one, obvious way to do things. What have you?
36
u/JarJarBinks237 2d ago
Imagine a format that needs an entire website to write strings properly.
https://yaml-multiline.info/
49
u/Shazvox 2d ago
JSON: Well established easily readable and formattable data structures.
YAML: Hard to read contexts and gets fucked up if reformatted. Devs didn't even come up with a serious name.
Who should be looking down on who? "Javascript Object Notation" 🧐 or "Yet Another Markup Language" 🤡?
127
u/ZunoJ 2d ago
Yaml sucks, it's the python of data formats
53
u/RomanOnARiver 2d ago
At least you're not staring at XML all day. Or worse, INI. Remember INI files? I was using INI for way longer than I would like to admit.
At least with JSON I can do the bit where I sing "JSON Derulo" to myself.
13
u/Economy-Isopod6348 2d ago
Yamal looking at Jason
55
u/DescriptionThick8515 2d ago
XML
25
u/RobSomebody 2d ago
Fuck YAML. All my homies hate YAML
16
u/Small_Computer_8846 2d ago
YAML while editing in vim 🤡
15
u/dvhh 2d ago
as long as you are not talk to Norway
7
u/clearlybaffled 2d ago
https://ruuda.nl/2023/the-yaml-document-from-hell
12
u/ampersand355 1d ago
White-space having meaning is dumb.
6
u/chris20194 2d ago
https://noyaml.com/
5
u/mrPythonMonty 2d ago
Enter TOML 🤪
5
u/Sir_Lith 17h ago
The moment you make whitespace syntactically relevant is the moment I start throwing eggs at you.
9
u/johnMidia 2d ago
I fucking hate languages and structures that are based on significant indentation. There, I said it... r/unpopularopinion
4
u/RafaFTP 1d ago
Yaml is shit
6
u/slyiscoming 2d ago
To be clear. YAML is the spawn of Satan.
3
u/StaticCoder 2d ago
I like that it allows comments. But the simplicity of parsing JSON is nice.
3
u/vr2391 2d ago
The real people know TOML is superior to YAML.
3
u/novus_nl 2d ago
Maybe i'm crazy but I dislike yaml.
or indentation in general to 'define context' (for the lack of a better description). just use a wrapper character instead and leave the formatting to me.
3
u/R1cwu 2d ago
I mean, since all JSON is technically also YAML... yes
3
u/Just_Information334 2d ago
XML: so, still working on reinventing me?
3
u/goondarep 1d ago
YAML is an utter and complete piece of trash. In my eyes it is much harder to read by a human (me). It’s like reading Python (shudder).
3
u/gutentight69420 1d ago
YAML is trash though
3
u/boss5667 1d ago
YAML for Config and JSON for data is what I feel.
5
u/visualdescript 2d ago
Lol, YAML is a plebs mark up language. It is not the mark up of the aristocracy. That would be xml + xsd
4
u/Pyran 2d ago
https://noyaml.com/
4
u/I_NEED_YOUR_MONEY 1d ago
you know the worst part of python? didn't you wish your data had that same problem?
2
u/Puzzleheaded-Weird66 2d ago
is protobuf better?
2
u/Aldebaraaaaaaan 2d ago
Honnestly, it's a picture of .ini, not yaml.
2
u/nhermosilla14 2d ago
Yaml is the most convenient way to write json.
2
u/Delpreti 1d ago
Yaml is not turing complete. People writing yamls and calling them "automations" or "ansible playbooks" are the worst. You wanna automate something, go use a real programming language, like shellscript or something
2
u/ITDudeProbably 1d ago
I only use YAML for configuration files, which I rarely touch, and I use Json to handle a lot of things. I've never found the two to be in conflict
2
u/cliffwolff 19h ago
Never used YAML, never will use YAML. But gosh wouldn't it be great if JSON supported comments.
2
u/P01001010 17h ago
I'd say XML rocks!
3
u/shashiadds 2d ago
XML
3
u/nedteel 2d ago
haha fuck yaml
3
u/SneakyDeaky123 1d ago
any language or spec which considers whitespace syntax is a joke
2
u/robthemonster 2d ago
i’ll give it to them for having comment support
2
u/MagicalPizza21 2d ago
People who know it's "YAML Ain't Markup Language" looking at those who think it's still "Yet Another Markup Language"
2
u/itzNukeey 2d ago
Yaml is a horrible format that does not have a standard and is a superset of JSON. Real ones use TOML or JSON
1
u/Specialist-Leek-357 2d ago
who's json
1
u/JetsonDad 2d ago
He's just watching and keeping tabs
1
u/Jhuyt 2d ago
I think yaml is stinky and I like making fun of falseway
1
u/525G7bKV 2d ago
Laughs in symbolic expressions.
1
u/LogicallyCross 2d ago
lol no
1
u/Schachtaube 2d ago
JSON would never let me down for a wrongly placed whitespace
1
u/jamcdonald120 2d ago
but.... JSON is the superior one.
YAML is the Monty python peasants who think they have a self governing autonomous collective.
1
u/Gluecksbaerchi 2d ago
Isn't YAML shorthand for yelling at my laptop?
1
u/sohang-3112 2d ago
Umm.. YAML is not good due to so many footguns (eg. "NO" silently becomes False, risk of remote code execution). I only use it when a tool requires it.
Use JSON or TOML, much better.
1
u/markvii_dev 2d ago
yaml is the python of config languages - sure its great when its a few lines but its a mess for anything serious.
1
u/Maskdask 2d ago
TOML is superior when it's for configuration
1
u/johnny-tinfoilhand 2d ago
Vaas looking at Jason:
https://i.ytimg.com/vi/rKMMCPeiQoc/sddefault.jpg
1
u/Overwatcher_Leo 2d ago
# JSON literally can't do this.
1
u/romulof 2d ago
Norway
1
u/thecrius 2d ago
Sure buddy
https://www.reddit.com/r/ProgrammerHumor/comments/9fhvyl/writing_yaml/
1
u/Suspicious_Sandles 2d ago
Enjoy your white space formatting I'll stick with my toml
1
u/thememorableusername 2d ago
Fuck YAML and JSON.
In this house we respect the XML name!
1
u/klimmesil 1d ago
Toml is king
1
u/TrueBirch 1d ago
Our custom reporting engine at work still uses XML. I've gotten good at writing XMK. That's a valuable and employable skill, right?
1
u/24032014 1d ago
Fuck yaml, it can go die in a hole. noyaml.com
1
u/slaymaker1907 1d ago
You misspelled toml. /s
But really, yaml is a horrendous language, far worse than JSONC. Way too many footguns like "no".
1
u/-Ambriae- 1d ago
Meanwhile the humble toml:
1
u/nalozisusmaranje 1d ago
If "Look at this arbitrary convoluted thing i can do for no benefit to anyone including myself" was a person.
1
u/soyrbto 1d ago
toml aupremacy supporter here
1
u/KryptoBlack 1d ago
YAML is JSON compatible so no matter what it does, JSON will always be there.
1
u/Skjalg 1d ago
toml looking at yaml
1
u/UristMasterRace 1d ago
JSON to YAML: I don’t think about you at all.
1
u/AlexeiMarie 1d ago
but what about textproto
1
u/andi2504 1d ago
I don't get the fuzz, it's nothing special. Yet another markdown language
1
u/cheezballs 1d ago
I only use YAML when I'm forced to. Fuck that shit. The amount of times I've been bit by a single space being off or forgetting how THIS version of YAML is supposed to handle collections. Fuck that mess! JSON 4 LIFE.
1
u/himanbam 1d ago
Personally I prefer storing config in a .txt file with an arbitrary and unique syntax that isn't documented anywhere. Gotta keep people guessing.
1
u/Iyemoja 1d ago
YAML looks down on JSON until one missing indent takes a deploy down at 2am. Then suddenly all those curly braces look very reassuring.
1
u/Brimstone117 1d ago
I think you have it backwards, OP.
1
u/TheRapie22 1d ago
yaml superior to json? in what world? whitespaces with semantic meaning are the worst
1
u/FFevo 1d ago
JSON for data. YAML for workflow definitions.
If you think they are competing solutions, you are wrong.
1
u/DeathNick 1d ago
https://imgflip.com/i/b6fn6u
1
u/reverendsteveii 1d ago
the other day my job hired a guy named J'son, who was explicit about the fact that it's pronounced JAY-son ("son" to rhyme with "on", not "sun").
1
u/deadron 1d ago
It would be looking in a mirror as yaml defined json as a subset. So a json file is a valid yaml file funny enough.
1
u/ComradePruski 1d ago
Everyone here is so upset about YAML... I have never had an issue with it in my professional career. Comments are such a bonus!
1
u/Playful_Boot_5465 1d ago
When I started my apprenticeship I also thought that yaml was better and announced it to my coworkers. They all roasted it to death
1
u/Dillenger69 1d ago
XML looking at both
1
u/bobbane 1d ago
And S-expressions look down on impoverished formats that have only strings and numbers.
((symbols "rule")(strings "drool"))
1
u/the_jester 1d ago
Do the sniper meme - it is TOML in the balcony.
1
u/Direct-Quiet-5817 1d ago
YOLO saan
1
u/flavionm 23h ago
YAML and JSON have different use cases. But turns out YAML is a piece of shit for its own use case.
1
u/Zashuiba 22h ago
Comments
1
u/RedAndBlack1832 21h ago
it's not that much easier to read if you print out your json on multiple lines lol. I would say it's easier to write which is why it's nice for a config or smth you might wanna edit by hand lmao