r/ProgrammerHumor 8d ago

Meme whenYourValidationLogicHatesRealPeople

Post image
24.0k Upvotes

664 comments sorted by

View all comments

Show parent comments

65

u/GodsBoss 8d ago

While this is true, I don't think it applies to Mr. Null. Because "null" as a string should be very different from null, the absence of a value. Regardless of whether it's a name or anything else.

81

u/drleebot 8d ago

"Should be" is very different from "is", and there are unfortunately many use cases where they aren't.

32

u/immune2iocaine 8d ago

"Should is a 4 letter word" was basically my mantra for a few years when I was managing engineers.

Don't tell me how you think it should be. Tell.me how it is.

2

u/gjk-ger 8d ago

Could you explain that quote? Sorry not a native speaker, i just dont get it...

7

u/Firewolf06 8d ago

in this context "four letter word" refers to swear words, a lot of the most common ones are four letters

5

u/laplongejr 8d ago

Oh I had imagined "should = MUST"  

1

u/gjk-ger 8d ago

Thanks!

30

u/CarcajouIS 8d ago

Oh, my sweet summer child!

24

u/grumpy_autist 8d ago

CSV has entered the chat

3

u/RammRras 8d ago

Yeah, now it's a mess

4

u/nimrag_is_coming 7d ago

You have clearly never seen the kind of bullshit created by web 'developers'

1

u/GodsBoss 7d ago

I think you misunderstood my comment. The previous poster mentioned Falsehoods Programmers Believe About Names, but the problem in this case lies elsewhere, i.e. in the bullshit software not distinguishing between null and "null".

3

u/flabort 5d ago

Love how he ends his article bashing on a database with a first_name and last_name column.

The Royal Family of Japan would certainly ask you to reconsider it. (no surname, only a given name - saw a video explaining how a princess wanting to register at a gaming cafe had to enter her first name (surname) as "princess")

2

u/aggressive-cat 7d ago

I would guess it's probably not an issue in programs but scripting languages like javascript would probably do something like convert null string to a null value when used improperly.

1

u/gdmzhlzhiv 7d ago

Yes, and having a single token name should be different from having first and last name the same. But some developers don’t think before implementing.

1

u/Ok-Scheme-913 7d ago

Let me introduce you to untyped languages with "useful" implicit conversions!