this post was submitted on 01 Aug 2023
294 points (94.3% liked)

Programmer Humor

19551 readers
723 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
 
you are viewing a single comment's thread
view the rest of the comments
[–] csm10495@sh.itjust.works 2 points 1 year ago* (last edited 1 year ago) (4 children)

Isn't NULL a macro in C for 0? So doesn't that mean these items are free?

In a way it's still the same with more modern languages. Especially OOP, setting an object to Null is just setting the address pointer to to 0x00000000.

Hence NullPointerException / NullReferenceException or similar, depending on the language.

[–] Haus@kbin.social 2 points 1 year ago (1 children)

I'd guess, in context, it's a floating point price column that hasn't been set, and the table designer didn't specify the column to be NOT NULL.

[–] csm10495@sh.itjust.works 2 points 1 year ago

I guess Rust would have solved the problem as well.

[–] kamenlady@lemmy.world 2 points 1 year ago

Null is zero in german - so this must be free, it's a german shop

[–] ImpossibleRubiksCube@programming.dev 1 points 1 year ago* (last edited 1 year ago)

It's a macro for zero in C, but they aren't literally the same thing. If you have a value which is zero, you have a value; if your value is null, then it means that you do not have a value; not even zero.

They could have just as easily made it a macro for 0xFFFF.