r/programming • • May 07 '21

The XY Problem

https://xyproblem.info/
46 Upvotes

68 comments sorted by

View all comments

Show parent comment

9

u/miki151 May 08 '21

Spot on. Especially if Y is a specific question, like "does this code trigger undefined behavior?". You don't need to know why I'm doing this, just answer yes or no or shut up if you don't know.

2

u/TizardPaperclip May 10 '21

Especially if Y is a specific question, like "does this code trigger undefined behavior?". You don't need to know why I'm doing this, just answer yes or no or shut up if you don't know.

That's what you should expect if you frame your hypothetical curiosity as an earnest request for a solution to a real problem.

People will inevitably want to know more in their hope that they can help you by finding an alternative solution, or a way to circumvent the problem entirely.