531
you are viewing a single comment's thread
view the rest of the comments
[-] nyan@lemmy.cafe 2 points 1 year ago

Exactly. Most languages I know of that allow this at all will coerce the "1" to an integer and give x = 2. They get away with this because they define the "+" operator as taking numbers only as arguments, so if you hand them x = x + "cheese" they'll error out.

this post was submitted on 17 Jul 2023
531 points (100.0% liked)

Programmer Humor

19480 readers
367 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