this post was submitted on 15 Jan 2025
88 points (98.9% liked)
Programmer Humor
32893 readers
941 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Mutating function arguments is pretty wtf to begin with.
true, and i can't think of a legitimate case where it would have tripped me up. but if someone, a novice perhaps, wrote
i think they would be within their rights to be surprised that calling this function twice has different results. that's what i was surprised by; it feels like bar would be re initialised each time with a scope of the function but apparenty not