this post was submitted on 23 Jun 2024
714 points (96.6% liked)

Programmer Humor

18206 readers
1321 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 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] orangeboats 23 points 4 days ago (2 children)

This is why I try my damnedest not to write in weakly typed languages.

string + object makes no logical sense, but the language will be like "'no biggie, you probably meant string + string so let's convert the object to string"! And so all hell breaks loose when the language's assumption is wrong.

[โ€“] [email protected] 4 points 3 days ago

You don't necessarily need types for that kind of thing though, a strict linter that flags that code works just as well

load more comments (1 replies)