this post was submitted on 29 Jun 2024
883 points (94.6% liked)

Programmer Humor

32174 readers
951 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
[โ€“] [email protected] 2 points 3 months ago (1 children)

It's all down to typing system. In PHP, providing null to string argument is a TypeError. You have to use ?string. Same in Typescript in strict mode. In Java, you can happily use null for everything without typesystem catching it.

NaN is a float standard thing, every language that implements floats has NaN.

[โ€“] dohpaz42 1 points 3 months ago

In my 18+ years as a PHP developer, I never once knew (at least afar as I can recall) that PHP supported NaN. TIL.