this post was submitted on 29 Jun 2024
904 points (95.0% liked)

Programmer Humor

37663 readers
174 users here now

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

Rules:

founded 6 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] rikudou 1 points 1 year 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@lemmy.world 1 points 1 year 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.