- cross-posted to:
- programmerhumor@lemmy.world
- programmerhumor@lemmy.ml
- cross-posted to:
- programmerhumor@lemmy.world
- programmerhumor@lemmy.ml
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…”
I got nothing against other types. Just numbers/misleading types.
Although, enum variants shall have a label field for identification if they aren’t automatically inferable.
Well, the issue is that JSON is based on JS types, but other languages can interpret the values in different ways. For example, Rust can interpret a number as a 64 bit int, but JS will always interpret a number as a double. So you cannot rely on numbers to represent data correctly between systems you don’t control or systems written in different languages.