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

Programmer Humor

23855 readers
2537 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
[–] r00ty@kbin.life 15 points 2 days ago (1 children)

Should it, or should it be "1"? (just removing one, one)

[–] grue@lemmy.world 4 points 2 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?

[–] __nobodynowhere@sh.itjust.works 12 points 2 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.

[–] Revan343@lemmy.ca 4 points 2 days ago

This is how we end up with an endian schism

[–] FooBarrington@lemmy.world 4 points 2 days ago

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

[–] anton@lemmy.blahaj.zone 3 points 2 days ago

maybe we removed the last n characters