r/ProgrammerHumor • • 6d ago

Meme formatsWithSuperiorityComplex

Post image
3.0k Upvotes

402 comments sorted by

1.3k

u/ClipboardCopyPaste 6d ago • Bravo

JSON slander will not be tolerated.

282

u/ArjunReddyDeshmukh 6d ago

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.

187

u/The-Chartreuse-Moose 6d ago

I've been burned too often by indentation to ever like YAML.

→ More replies (1)

21

u/turkphot 5d ago

RIP Jason Slander

13

u/GoogleIsYourFrenemy 5d ago

What's that JSON? Do you have a comment to make? Right, I didn't think so.

3

u/Doyoulikemyjorts 5d ago

It can and it will

→ More replies (1)

1.6k

u/anzu3278 6d ago

Any language where whitespace is syntax can go die in a hole

140

u/ArjunReddyDeshmukh 6d ago

YAML was created by solution architects to talk to each other.

105

u/ultraviolentfuture 6d ago

So glad those solution architects provided a solution that solved the problem, so this entire meme and convo thread don't need to exist.

60

u/BanditoRojo 6d ago

<thread type="convo"><post id="1"><content>I like xml</content><post id="2"><content>How do I read this crap?</content></post></post></thread>

→ More replies (2)
→ More replies (1)

263

u/requion 5d ago

# YAML isn't scared of comments at least

78

u/ThePresidentOfStraya 5d ago

{ "comment" : { "value" : "JSON wins everytime." } }

16

u/Ghi102 5d ago

What do I do if my JSON documents is meant to store comments (like Reddit or Youtube comments?). 

21

u/ynnnnaD 5d ago

Use different keys for the actual content payload, and the descriptive structural comments?

→ More replies (3)
→ More replies (5)
→ More replies (3)

7

u/uvero 5d ago

JSON5

112

u/anzu3278 5d ago

If you need comments in json your schema is just bad

→ More replies (6)

21

u/nderscore_ 5d ago

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.

23

u/Lalli-Oni 5d ago

Object notation. Its not called JSDTO.

→ More replies (4)

11

u/garnet420 5d ago

Good thing json is not a good message exchange format either.

→ More replies (5)

2

u/BeABetterHumanBeing 5d ago

For those of you who are wondering: comments are not supported in the official JSON standard because when they started allowing it in the past, people immediately began abusing it to build pragma-style metaprogramming directives that sent it straight to hell.

→ More replies (3)

57

u/SchalkLBI 6d ago

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.

17

u/redd1ch 6d ago

If the parser supports YAML 1.2. Pyyaml doesn't.
In JSON mode, you can even use tabs for indentation.

11

u/SchalkLBI 6d ago

Good thing Python isn't the only language that can parse YAML then! But that does sound like an issue with Pyyaml, not like an issue with YAML's spec

31

u/redd1ch 6d ago

"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.

→ More replies (2)
→ More replies (2)

2

u/Valuable_Leopard_799 5d ago

Nix's toYaml function is just an alias for toJSON , hehe

→ More replies (1)

12

u/teraflux 6d ago

Python would like a word

22

u/knightshire 5d ago

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. 

4

u/philippefutureboy 5d ago

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

→ More replies (3)

18

u/NotableCarrot28 6d ago

Python is not a good example here lol

→ More replies (9)

5

u/anzu3278 5d ago

Yeah exactly python is a stupid ass language that wouldn't exist if there weren't bad programmers who think declaring types is scary

→ More replies (7)

335

u/rjwut 6d ago

Heck no, YAML can go suck an egg.

  • 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.

91

u/L30N1337 6d ago

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.

59

u/rjwut 6d ago

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.

8

u/pterencephalon 5d ago

I use TOML because it at least deals with the type issues

→ More replies (3)

38

u/chat-lu 6d ago

JSON for computers talking to computers

Hell no. JSON to provide the lowest common denominator. We have much better interchange formats when you control both ends of the conversation.

JSON5 for configuration written by human beings.

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.

6

u/hennypennypoopoo 5d ago

TOML is the way for configuration. If you can't make it look nice in TOML, it shouldn't be a configuration option.

10

u/rjwut 6d ago

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.

3

u/CrossScarMC 5d ago

JSON for computers talking to computers

That's what MessagePack is for, it's really a shame it hasn't been adopted very much.

→ More replies (2)

2

u/Prawn1908 5d ago

JSON for computers talking to computers

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.

Agreed yaml is stupid though.

5

u/rjwut 5d ago

I would be 100% in agreement if byte economy were the only thing that mattered in all cases.

→ More replies (5)
→ More replies (9)

136

u/GrimReaper2601 6d ago

YAML looking down on JSON until someone accidentally presses the spacebar 3 times instead of 2.

57

u/critical_blunder 5d ago

Tab formatted languages are the absolute worst. Just get some brackets and be done. The tabs are a luxury

26

u/GrimReaper2601 5d ago

Python devs in the back sweating profusely right now.

17

u/erinaceus_ 5d ago

Well, they're python devs, so that makes sense ...

4

u/Blue_Moon_Lake 5d ago

Indent, not tab.

Not only are YAML/Python using meaningful indentation level, they spurn the tab character to make it even more error prone.

→ More replies (3)

67

u/seniorsassycat 6d ago

No

25

u/NewbornMuse 6d ago

Yaml thinks your comment is false

9

u/MichiRecRoom 5d ago

Even though it was clearly meant to represent Norway.

29

u/no_brains101 6d ago edited 6d 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.

50

u/suvlub 6d ago

Imagine a format so messy it can't even figure out what it is, Mr. "Yet Another Markup Language Ain't Markup Language"

287

u/Fast-Visual 6d ago edited 6d 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.

127

u/Blue_Moon_Lake 6d ago

I can't read YAML because of my eyesight and YAML refusal to use tabs.

15

u/RomanOnARiver 6d ago

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.

11

u/WlmWilberforce 5d ago

Set tab = 4*spaces in your editor

→ More replies (12)

13

u/dasunt 6d ago

Try adding color to your indentation levels, either through config changes or plugins.

13

u/Ledeste 5d ago edited 5d ago

If you need a plugin to read your file, then the format is not readable

15

u/Blue_Moon_Lake 6d ago

So I see a smudged rainbow instead of a smudge?

→ More replies (1)
→ More replies (5)

68

u/iamapizza 6d ago

readability

Laughs in the atrocity that is k8s 

69

u/static_func 6d ago

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

→ More replies (1)

16

u/thefirelink 6d ago

K8s can use json instead of yaml. It converts the yaml to json anyway

12

u/static_func 6d ago

Everything can because yaml’s actually just a superset of json. You can even write json in your yaml, because why not

→ More replies (2)
→ More replies (1)

20

u/alonjit 6d ago

I actually really really like YAML

I really like to smoke whatever you're smoking. It must be good shit.

2

u/RomanOnARiver 6d ago

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.

2

u/shnaptastic 6d ago

They’re both supposed to be human readable formats, so those other aspects are not really important.

4

u/Positive_Mud952 6d ago

My droog I can tell you’re a real programmer because you
think “indent 8 spaces, then |>” is human friendly.

I mean it is, to some humans. But not even most programmers.

→ More replies (37)

40

u/Scientific_Artist444 6d ago

TOML looking at YAML:

I have just one, obvious way to do things. What have you?

15

u/redd1ch 6d ago

YAML: I have remote code execution *by desgin*. Can you compete with that?

3

u/CirnoIzumi 6d ago

Yaml: I don't make it look like I can place newlines where it would break the parser

→ More replies (2)

37

u/JarJarBinks237 6d ago

Imagine a format that needs an entire website to write strings properly.

https://yaml-multiline.info/

50

u/Shazvox 6d 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" 🤡?

11

u/Tohaker 6d ago

It's worse - YAML changed what it stands for and it's now "YAML Ain't Markup Language"

https://yaml.org/

5

u/Shazvox 6d ago

A recursive abbrevasion? Disgusting...

string YAML(string text) =>  "{{ YAML(text) }} Ain't Markup Language"

...or something like that

→ More replies (1)

56

u/RomanOnARiver 6d 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.

18

u/oldsecondhand 6d ago

I'd take XML.

13

u/Ghi102 5d ago

No joke, XML has a few benefits. Like comments and versioning.

Still mind-blowing to me that JSON still has no official comments support

6

u/Blue_Moon_Lake 5d ago

The horror of XML is that you can make things ugly very quickly.

  • Mixed elements that aren't "properties"
  • Element having some properties as properties and some as children elements

Eg.

<ItemList>
    <FooItem property="foo"></Foo>
    <BarItem>
        <Property> bar </Property>
    </Bar>
    <QuxItem>
        <Property value="qux" />
    </Qux>
</ItemList>
→ More replies (1)

7

u/nimrag_is_coming 5d ago

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

6

u/ynnnnaD 5d ago

I miss INI files, honestly. When they were popular was a magical time in coding.

6

u/bwmat 5d ago

Like others have said, there's value in the simplicity of INI

11

u/Keavon 5d ago

INI, also known as TOML, is good. Really good. More people should use TOML.

4

u/BSFGP_0001 5d ago

INI and TOML are differend formats

→ More replies (1)
→ More replies (1)
→ More replies (1)

130

u/ZunoJ 6d ago

Yaml sucks, it's the python of data formats

30

u/rjwut 6d ago

I'd be a lot more on board with Python if it weren't for the syntactically-meaningful whitespace. I don't need that kind of negativity in my life.

13

u/ZunoJ 6d ago

Same for me. People complain about LISPs syntax and then go on fuck around with that python abomination

8

u/alexchrist 6d ago

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

12

u/pink-ming 6d ago

honestly don't get why this bothers people so much. everyone does semantic indenting in every other language anyway

9

u/Valthek 5d ago

It's because it's unintuitive and unclear.
It's not always immediately obvious how much whitespace there is and counting it is a pain in the ass.

→ More replies (7)
→ More replies (1)

6

u/You_meddling_kids 6d ago

True is a keyword

true is a variable

Come the fuck on.

→ More replies (2)

21

u/Ulrich_de_Vries 6d ago

But that would mean it's good, whereas it isn't.

4

u/ZunoJ 6d ago

It's a matter of taste. I don't like it at all. Not as bad as java script but close. Also it is ugly as shit IMO

→ More replies (5)

3

u/sageknight 6d ago

Huh. I like json more because it's just like python dict.

→ More replies (3)

13

u/Economy-Isopod6348 6d ago

Yamal looking at Jason

56

u/DescriptionThick8515 6d ago

XML

35

u/amzwC137 6d ago

CSV

7

u/kratz9 5d ago

The backbone of big business. 

10

u/Jhuyt 6d ago

I think xml for all its verbosity is kinda neat

→ More replies (2)

7

u/wil_is_cool 5d ago

XML is God's markup, and I feel bad for anyone that says otherwise as they have not yet reached enlightenment

3

u/CraftBox 5d ago

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.

4

u/SLCtechie 6d ago

Get on, get.

→ More replies (1)

25

u/RobSomebody 6d ago

Fuck YAML. All my homies hate YAML

16

u/Small_Computer_8846 6d ago

YAML while editing in vim 🤡

2

u/Blue_Moon_Lake 5d ago

And then you're off by one whitespace somewhere.

16

u/dvhh 6d ago

as long as you are not talk to Norway

12

u/ampersand355 5d ago

White-space having meaning is dumb.

6

u/Sir_Lith 4d ago

The moment you make whitespace syntactically relevant is the moment I start throwing eggs at you.

5

u/mrPythonMonty 6d ago

Enter TOML 🤪

9

u/johnMidia 5d ago

I fucking hate languages and structures that are based on significant indentation. There, I said it... r/unpopularopinion

6

u/CraftBox 5d ago

I think you meant r/popularopinion

2

u/johnMidia 5d ago

Most people will say that python indentation is "superior".

→ More replies (1)

4

u/RafaFTP 5d ago

Yaml is shit

6

u/slyiscoming 6d ago

To be clear. YAML is the spawn of Satan.

3

u/StaticCoder 6d ago

I like that it allows comments. But the simplicity of parsing JSON is nice.

3

u/vr2391 6d ago

The real people know TOML is superior to YAML.

3

u/novus_nl 6d 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 6d ago

I mean, since all JSON is technically also YAML... yes

3

u/Just_Information334 6d ago

XML: so, still working on reinventing me?

3

u/goondarep 5d 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 5d ago

YAML is trash though

3

u/boss5667 5d ago

YAML for Config and JSON for data is what I feel.

5

u/visualdescript 6d ago

Lol, YAML is a plebs mark up language. It is not the mark up of the aristocracy. That would be xml + xsd

→ More replies (1)

4

u/I_NEED_YOUR_MONEY 5d ago

you know the worst part of python? didn't you wish your data had that same problem?

2

u/Puzzleheaded-Weird66 6d ago

is protobuf better?

2

u/Blue_Moon_Lake 5d ago

Protobuf is like someone trying to make JSON and ZIP a single thing.

It's bad...

→ More replies (1)

2

u/Aldebaraaaaaaan 6d ago

Honnestly, it's a picture of .ini, not yaml.

2

u/nhermosilla14 5d ago

Yaml is the most convenient way to write json.

2

u/Delpreti 5d 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 5d 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 4d ago

Never used YAML, never will use YAML. But gosh wouldn't it be great if JSON supported comments.

2

u/P01001010 4d ago

I'd say XML rocks!

3

u/nedteel 5d ago

haha fuck yaml

3

u/SneakyDeaky123 5d ago

any language or spec which considers whitespace syntax is a joke

2

u/robthemonster 6d ago

i’ll give it to them for having comment support 

2

u/MagicalPizza21 6d 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 5d 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/JetsonDad 6d ago

He's just watching and keeping tabs

1

u/Jhuyt 6d ago

I think yaml is stinky and I like making fun of falseway

1

u/525G7bKV 6d ago

Laughs in symbolic expressions.

1

u/Schachtaube 6d ago

JSON would never let me down for a wrongly placed whitespace

1

u/jamcdonald120 6d 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 6d ago

Isn't YAML shorthand for yelling at my laptop?

1

u/sohang-3112 6d 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 6d 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 6d ago

TOML is superior when it's for configuration

1

u/Overwatcher_Leo 5d ago

# JSON literally can't do this.

1

u/romulof 5d ago

Norway

1

u/Suspicious_Sandles 5d ago

Enjoy your white space formatting I'll stick with my toml

1

u/thememorableusername 5d ago

Fuck YAML and JSON.
In this house we respect the XML name!

1

u/klimmesil 5d ago

Toml is king

1

u/TrueBirch 5d 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 5d ago

Fuck yaml, it can go die in a hole. noyaml.com

1

u/slaymaker1907 5d 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- 5d ago

Meanwhile the humble toml:

1

u/nalozisusmaranje 5d ago

If "Look at this arbitrary convoluted thing i can do for no benefit to anyone including myself" was a person.

1

u/soyrbto 5d ago

toml aupremacy supporter here

1

u/KryptoBlack 5d ago

YAML is JSON compatible so no matter what it does, JSON will always be there.

1

u/Skjalg 5d ago

toml looking at yaml

1

u/UristMasterRace 5d ago

JSON to YAML: I don’t think about you at all.

1

u/AlexeiMarie 5d ago

but what about textproto

1

u/andi2504 5d ago

I don't get the fuzz, it's nothing special. Yet another markdown language

1

u/cheezballs 5d 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 5d 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/Brimstone117 5d ago

I think you have it backwards, OP.

1

u/TheRapie22 5d ago

yaml superior to json? in what world? whitespaces with semantic meaning are the worst

1

u/FFevo 5d ago

JSON for data. YAML for workflow definitions.

If you think they are competing solutions, you are wrong.

1

u/reverendsteveii 5d 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 5d 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 5d 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 5d 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 5d ago

XML looking at both

1

u/bobbane 5d ago

And S-expressions look down on impoverished formats that have only strings and numbers.

((symbols "rule")(strings "drool"))

1

u/the_jester 5d ago

Do the sniper meme - it is TOML in the balcony.

1

u/flavionm 4d 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 4d ago

Comments

1

u/RedAndBlack1832 4d 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

1

u/kus1987 3d ago

mom said it is my turn to post this next time

1

u/sebbdk 13h ago

Have you heard about our lord and savior Toml?