this post was submitted on 29 Jun 2024
897 points (94.9% liked)

Programmer Humor

32175 readers
341 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] alexc@lemmy.world 7 points 3 months ago (7 children)

I don’t know what the hate is unless you are trying to store time as a String property. There a special place in hell for all developers who do this.

IMHO, all you really need to know is an Epoch time stamp and whether it’s localized to the viewer or the creator… Not that complex. The problem with time zones is that politicians keep changing them

Honestly, I’d rather give the creator of NULL a slap.

[–] coffeejoe@lemmy.dbzer0.com 2 points 3 months ago (1 children)

What’s wrong with NULL? How else can you differentiate between not having a value and having a blank value?

[–] davidagain@lemmy.world 1 points 3 months ago* (last edited 3 months ago)

The problem isn't having empty values, it's not tracking that in the type system, so the programmer and the compiler don't have any information about whether a value can be null or not and the programmer has to figure it out by hand. In a complex program that's essentially completely impossible. The innocently created bomb that causes your program to crash can be in absolutely any value.

There are ways to track it all by disallowing null and using optional values instead, but some folks would rather stick with type systems that haven't moved on since the 1960s.

load more comments (5 replies)