this post was submitted on 04 Jun 2025
1013 points (98.6% liked)

Programmer Humor

23849 readers
2208 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
[โ€“] fushuan@lemm.ee 2 points 2 days ago (1 children)

It makes perfect sense if the Lang objective is to fail as little as possible. It picks the left side object, checks if the operand is a valid operand of the type. If it is, it casts the right variable into that type and perform the operand. If it isn't, it reverses operand positions and tries again.

The issue here is more the fact that + is used both as addition and as concatenation with different data types. Well, not an issue, just some people will complain.

[โ€“] grue@lemmy.world 2 points 2 days ago

Computing a nonsensical result is itself a failure. Continuing to run while avoiding giving an error in that case accomplishes nothing but to make the program harder to debug.