this post was submitted on 17 May 2025
351 points (97.3% liked)

Programmer Humor

23563 readers
1209 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 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 18 points 2 weeks ago (3 children)

The one option that is mandated by an ISO standard.

Besides, if max and min are going to have a value without any parameter, it has to be exactly those Javascript uses. Unless you have a type that define other bounds for your numbers. And null always have a pointer type (that is object in Javascript), for the same reason that NaN always have a number type.

The only one that is bad on that list is D.

[–] [email protected] 7 points 2 weeks ago (1 children)

typeof null === "object" was actually a bug in the early implementations, and they decided to keep it in the spec: https://2ality.com/2013/10/typeof-null.html

(see the comment from Brendan Eich)

[–] [email protected] 6 points 2 weeks ago* (last edited 2 weeks ago) (2 children)

Tony Hoare: "Introducing NULL was a billion-dollar mistake"

Brendan Eich: "Hold my undefined"

[–] [email protected] 10 points 2 weeks ago

We had one null, yes. But what about second null?

[–] [email protected] 6 points 2 weeks ago

Maybe D is too single quotes 0 == ''

[–] [email protected] 4 points 2 weeks ago

D...Deez nutz!