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…”
These JSON memes got me feeing like some junior dev out there is upset because they haven’t read and understood the docs.
It’s the API’s job to validate it either way. As it does that job, it may as well parse the string as an integer.
Explicit types are just laziness, you should be catching exceptions anyways.
“1” + “1”
“11”
CBOR for life, down with JSON.
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.
Yaml is more human readable/editable, and it’s a superset of json!
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.
Yaml is just arcane bullshit to actually write as a human. Nor is it intuitively clear how yaml serializes.
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.