this post was submitted on 15 Oct 2023
304 points (95.2% liked)
Programmer Humor
32503 readers
346 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
It could be that this is a habit left over from pascal, where result is a reserved word, and is automatically made the return value of the function.
If it is in the context of a short function, I don't see that it's all that bad.
Yup, I also do that. If I just need a variable to put in what will be returned, I call it
result
. What it means should be clear from the function name. Repeating that feels redundant.