this post was submitted on 30 Jun 2024
281 points (94.9% liked)

Programmer Humor

19589 readers
468 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
[–] masterspace@lemmy.ca 0 points 4 months ago* (last edited 4 months ago) (5 children)

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

[–] agressivelyPassive@feddit.de 0 points 4 months ago (4 children)

Did you read the comments above?

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

[–] docAvid@midwest.social 1 points 4 months ago (3 children)

At the (SQL) database level, if you are using null in any sane way, it means "this value exists but is unknown". Conflating that with "this value does not exist" is very dangerous. JavaScript, the closest thing there is to a reference implementation for json serialization, drops attributes set to undefined, but preserves null. You seem to be insisting that null only means "explicit omission", but that isn't the case. Null means a variety of subtly different things in different contexts. It's perfectly fine to explicitly define null and missing as equivalent in any given protocol, but assuming it is not.

[–] Saizaku@lemmy.dbzer0.com 1 points 4 months ago

At the (SQL) database level, if you are using null in any sane way, it means "this value exists but is unknown".

Null at the SQL means that the value isn't there, idk where you're getting that from. SQL doesn't have anything like JS's undefined, there's no other way to represent a missing value in sql other than null (you could technically decide on certain values for certain types, like an empty string, but that's not something SQL defines).

load more comments (2 replies)
load more comments (2 replies)
load more comments (2 replies)