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

Programmer Humor

23899 readers
1411 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
[–] [email protected] 4 points 3 days ago (3 children)

Which "1" did it remove? And did it search the string to find a "1" to remove, or did it remove whichever character happened to be at array index 1?

[–] [email protected] 12 points 3 days ago (1 children)

The one at the end. Subtraction is the opposite of addition. If addition adds a character to the end of the string, it must follow that subtraction would remove a character from the end of the string.

[–] [email protected] 4 points 3 days ago

This is how we end up with an endian schism

[–] [email protected] 4 points 3 days ago

It should just randomly pick any "1". Add a bit of spice, you know

[–] [email protected] 3 points 3 days ago

maybe we removed the last n characters