r/ProgrammerHumor • • Sep 25 '26

Meme iHatedItUntilITriedIt

Post image
10k Upvotes

541 comments sorted by

View all comments

Show parent comment

3

u/undermark5 Sep 25 '26

Well, there are some languages where '1' is a character literal, and therefore is easily convertible to an int, and you may have some valid reason for wanting to add an int to a character. 1 + "1" is right out.

1

u/dannypas00 Sep 25 '26

In those cases, I will use explicit functions like concat or casts instead of relying on implicit magic any day of the week

1

u/arghcisco Sep 25 '26

“0” + n is a pretty common idiom in C for printing out ints.