this post was submitted on 30 Jun 2024
276 points (94.8% liked)

Programmer Humor

18958 readers
1140 users here now

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

founded 1 year ago
MODERATORS
 

Meme transcription: Panel 1. Two images of JSON, one is the empty object, one is an object in which the key name maps to the value null. Caption: “Corporate needs you to find the difference between this picture and this picture”

Panel 2. The Java backend dev answers, “They’re the same picture.”

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 1 points 1 month ago (1 children)

I (think, at least) the point they're making is that unless the API contract specifically differentiates between "present and null" and "absent" then there is no difference. (Specifically for field values.)

[–] [email protected] 0 points 1 month ago

The point I'm making is kind of the opposite, unless the contract explicitly states that they're the same they should not be treated as the same, because at a fundamental level they are not the same thing even if Java wants to treat them as such.