Meme transcription:

Panel 1: Bilbo Baggins ponders, “After all… why should I care about the difference between int and String?

Panel 2: Bilbo Baggins is revealed to be an API developer. He continues, “JSON is always String, anyways…”

You are viewing a single thread.
View all comments
18 points

CBOR for life, down with JSON.

permalink
report
reply
3 points

Hell, no. If I wanted to save bytes, I’d use a binary format, or just fucking zip the JSON. Looking at a request-response pair and quickly understanding the transferred data is invaluable.

permalink
report
parent
reply
-1 points

Yaml?

permalink
report
parent
reply
1 point

For the love of all things pure, holy, and just, please do not use YAML in your APIs…

permalink
report
parent
reply
1 point

Fine, and if you don’t use json in your API because of the deficiency highlighted in the meme, what format do you use in your API?

permalink
report
parent
reply
3 points

If you’re moving away from text formats, might as well use a proper serialisation tool like protobuf…

permalink
report
parent
reply
9 points

If there are no humans in the loop, sure, like for data transfer. But for, e.g., configuration files, i’d prefer a text-based solution instead of a binary one, JSON is a nice fit.

permalink
report
parent
reply
1 point

Yaml is more human readable/editable, and it’s a superset of json!

permalink
report
parent
reply
2 points

Until someone cannot tell the difference between tab and space when configuring or you miss one indentation. Seriously, whoever thinks indentation should have semantic meaning for computers should burn in hell. Indentation is for us, humans, not computers. You can write a JSON with or without indentation if you want. Also, use JSON5 to have comments and other good stuff for a config file.

permalink
report
parent
reply
1 point

It’s entirely disingenuous because who the hell is throwing JSON into YAML without converting it? Oh wow, I changed the file extension and it still works. I’m so glad we changed to YAML!

permalink
report
parent
reply
1 point

Yaml is cancer.

permalink
report
parent
reply
2 points

Yaml is just arcane bullshit to actually write as a human. Nor is it intuitively clear how yaml serializes.

permalink
report
parent
reply
1 point

What I’d like for a configuration language is a parser that can handle in-place editing while maintaining whitespace, comments, etc. That way, automatic updates don’t clobber stuff the user put there, or (alternatively) have sections of ### AUTOMATIC GENERATION DO NOT CHANGE###.

You need a parser that handles changes on its own while maintaining an internal representation. Something like XML DOM (though not necessarily that exact API). There’s a handful out there, but they’re not widespread, and not on every language.

permalink
report
parent
reply
1 point

JSON5

permalink
report
parent
reply
9 points
*

What, no! Use TOML or something for config files.

permalink
report
parent
reply
6 points

TOML

Interesting… me likes it.

permalink
report
parent
reply

Programmer Humor

!programmer_humor@programming.dev

Create post

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics

Community stats

  • 2K

    Monthly active users

  • 861

    Posts

  • 14K

    Comments