this post was submitted on 30 Jun 2024
227 points (97.1% liked)

Programmer Humor

31214 readers
104 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 4 years ago
MODERATORS
 

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 comment's thread
view the rest of the comments
[–] [email protected] 33 points 2 days ago* (last edited 2 days ago) (6 children)

JSON has types.

Many API developers may choose not to use them, but they are absolutely there.

You specify the type by including or excluding quotation marks, and then for the types without quotation marks, you either include or exclude a decimal point to specify float or integer, and for boolean you use characters (specifically true or false). Arrays are wrapped in [] and objects are wrapped in {}.

JSON data as a whole is passed as one giant string because the REST protocol demands it. But once it's been pulled in and properly interpreted, there are absolutely types in the data.

[–] [email protected] 10 points 1 day ago (4 children)

Absolutely. Who doesn’t type JSON?

[–] [email protected] 6 points 1 day ago* (last edited 1 day ago)

We aren't using json.atChar(17) to get values?

load more comments (3 replies)
load more comments (4 replies)