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

  • masterspace@lemmy.ca
    link
    fedilink
    English
    arrow-up
    2
    arrow-down
    1
    ·
    edit-2
    8 months ago

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

    • AggressivelyPassive@feddit.de
      link
      fedilink
      arrow-up
      1
      arrow-down
      2
      ·
      8 months ago

      Did you read the comments above?

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

      • Doc Avid Mornington@midwest.social
        link
        fedilink
        English
        arrow-up
        4
        ·
        8 months ago

        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.