this post was submitted on 21 Feb 2025
4 points (100.0% liked)

Programming

18831 readers
511 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
 

The word, used by computer scientists to mean ‘no value,’ has created long-running challenges

top 19 comments
sorted by: hot top controversial new old
[–] MonkderVierte@lemmy.ml 1 points 2 weeks ago (1 children)
[–] 0x0@programming.dev 1 points 2 weeks ago* (last edited 2 weeks ago)

This seems to be old news, and paywalled.

Edit: gee, thanks MSN. The article i'd read was about the license plate.

Morgan Null, in black, with her parents and brother, all Nulls. lol

Not that rare of a name apparently...

[–] pHr34kY@lemmy.world 1 points 2 weeks ago* (last edited 2 weeks ago) (1 children)

I've seen XML parsers that will convert element content from strings to native types by default. So "0" becomes an int, "true" becomes a boolean, and "null" becomes an actual null. I had to take extra steps to keep everything as a string unless explicitly told not to.

JSON does not have this problem, BTW.

[–] calcopiritus@lemmy.world 0 points 2 weeks ago (3 children)

I don't think anyone actually chooses XML. There's no reason to use it over JSON unless you need to.

[–] lord_ryvan@ttrpg.network 1 points 1 week ago (1 children)

XML can validate itself and there's the self-documenting WSDL; so while it has more overhead and an ugly syntax it can make for a more stable and earlier to understand API for your API's consumers.

[–] calcopiritus@lemmy.world 1 points 1 week ago

This point is always stated about XML as if it were the most important part of choosing XML.

But jsonschema exists. It has the same capability.

[–] brian@programming.dev -1 points 2 weeks ago* (last edited 2 weeks ago)

json is fine as a serialization format for things that need to be text, but it's not great as something that gets edited by hand.

not that I enjoy xml, but writing long strings in json is even worse. xml I can write multiline strings as a first class entity.

I can add a comment to an xml document, json I have to write something hacky like "//": "my comment" and hope whatever is consuming it doesn't care.

there's just as many problems with json parsers, since most but not all of them treat numbers as js numbers, which are basically floats. you can't rely on an arbitrary consumer having support to parse ints above a certain size so you just have to make everything a string and hope.

json allows duplicate keys, but they get overridden by the last occurrence. you can't round trip json without losing something. you can't rely on just seeing a key value in json text and that being correct since there could be another later. doesn't come up often but it's there.

[–] ChairmanMeow@programming.dev -1 points 2 weeks ago (1 children)

The entirety of the banking world uses XML very heavily, as it's part of the SWIFT standards.

[–] calcopiritus@lemmy.world 1 points 2 weeks ago

I didn't say that it's not used. I say that you shouldn't if you have the option.

If the entire X world uses Y technology. You have no choice other than using Y technology.

[–] PhobosAnomaly@feddit.uk 0 points 2 weeks ago* (last edited 2 weeks ago) (1 children)

Taking the issue at face value, I wonder what Johnny Null's workaround would be for his (or their) name?

N'ull? Nul-l? \Null? Null? JohnnyN ull?

[–] drunkosaurus@lemmy.dbzer0.com 0 points 2 weeks ago (1 children)

Definitely not N'ull, that would trigger a SQL error when it can't interpret the ull after the string delimiter.

[–] 0x0@programming.dev 1 points 2 weeks ago
[–] solrize@lemmy.world 0 points 2 weeks ago (1 children)

Wait til they meet my friend Little Bobby Tables.

[–] Schal330@lemmy.world 1 points 2 weeks ago* (last edited 2 weeks ago)

At this point I would think most people know, but for those who don't:

https://xkcd.com/327

[–] remotelove@lemmy.ca 0 points 2 weeks ago (2 children)

Who the hell writes if 'null'? If it's a thing, what language would interpret a string like that?

[–] lord_ryvan@ttrpg.network 1 points 1 week ago* (last edited 1 week ago)

It's fine in PHP, so that catches most server backends.

Ruby as well, it even raises a warning about the string where a bool should be!

Python handles it just fine, as well.

Rust doesn't allow it, depending on the backend framework and server software this might give issues.

The same goes for C# .NET

So depending on how this is handled a C# or Rust backend might cause the name not to be stored, but then I'd expect nothing to be stored... :/

[–] SpaceNoodle@lemmy.world 0 points 2 weeks ago (1 children)
[–] sir_pronoun@lemmy.world -1 points 2 weeks ago