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 thread.
View all comments View context
3 points

Null means I’m telling you it’s null.

Omission means it’s not there and I’m not telling you anything about it.

There is a world of difference between those two statements. It’s the difference between telling someone you’re single or just sitting there and saying nothing.

permalink
report
parent
reply
1 point

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.)

permalink
report
parent
reply
0 points

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.

permalink
report
parent
reply
-2 points

Nope.

If there’s a clear definition that there can be something, implicit and explicit omission are equivalent. And that’s exactly the case we’re talking about here.

permalink
report
parent
reply
-1 points
*

Sure, in a specific scenario where you decide they’re equivalent they are, congratulations. They’re not generally.

permalink
report
parent
reply
0 points

Did you read the comments above?

You can’t just ignore context and proclaim some universal truth, which just happens to be your opinion.

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

  • 7.4K

    Monthly active users

  • 760

    Posts

  • 12K

    Comments