XY Problem
jdporter
created: 2006-04-10 14:11:27

Every now and then I hear people say I might have an "XY problem". What is that?

"XY Problem" explanations by various explerts:

You want to do X, and you think Y is the best way of doing so. Instead of asking about X, you ask about Y.
    — from node 87035 by Abigail

You're trying to do X, and you thought of solution Y. So you're asking about solution Y, without even mentioning X. The problem is, there might be a better solution, but we can't know that unless you describe what X is.
    — from Re: How do I keep the command line from eating the backslashes? by revdiablo

Someone asks how to do Y when they really want to do X. They ask how to do Y because they believe it is the best way to accomplish X. People trying to help go through many iterations of "try this", followed by "that won't work because of". That is, depending on the circumstances, other solutions may be the way to go.
    — from node 327963 by Limbic~Region

To answer question Y, without understanding larger problem (the context) X, will most likely *not* help them entirely with X.
    — from by merlyn

A.k.a. "premature closure": the questioner wanted to solve some not very clearly stated X, they concluded that Y was a component of a solution, and now they're asking how to implement Y.
    — from by Alan J. Flavell

The XY problem is when you need to do X, and you think you can use Y to do X, so you ask about how to do Y, when what you really should do is state what your X problem is. There may be a Z solution that is even better than Y, but nobody can suggest it if X is never mentioned.
    — from by Tad McClellan

When people come [in here] asking how to do something stupid, I'm never quite sure what to do. I can just answer the question as asked, figuring that it's not my problem to tell people that they're being stupid. . . . But if I do that, people might jump on me for being a smart aleck, which has happened at times. ("Come on, help the poor guy out; if you know what he really need why don't you just give it to him?")
. . .
On the other hand, I could try to answer on a different level, present a better solution, and maybe slap a little education on 'em. That's nice when it works, but if it doesn't it's really sad to see your hard work and good advice ignored. Also, people tend to jump on you for not answering the question. ("Who are you to be telling this guy what he should be doing? Just answer the question.")
. . .
I guess there's room for both kinds of answer. Or maybe there isn't room for either kind.
    — from <6lnb70$lct$1@monet.op.net> by MJD

Too bad that the more general problem, X, is often considered off topic for this forum. Y has more of a chance to look like a Perl problem.
    — from by bart

See also node 233565, an excellent article by merlyn, where he quotes this message he posted on on the unix-porting mailing list.)


We're building the house of the future together.
Re: XY Problem
created: 2006-04-10 14:59:29
And here I was thinking they were referring to my chromosomes! ;^)
Re: XY Problem
created: 2006-04-10 15:04:03
If X and Y fail to please, just move on to the Z's :-)

I'm not really a human, but I play one on earth. flash japh
Re: XY Problem
created: 2006-04-10 15:55:37

Excellent++! We can now post a reply along the lines of "I think you have an XY Problem. You are asking us how to do Y, but ..."

Re: XY Problem
created: 2006-04-10 16:59:48
The ABC of the XY(Z) problem. ++

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

Re: XY Problem
xdg
created: 2006-04-10 17:08:12

Some related problems:

  • YX Problem: You explain that you want to do X and instead of an answer you're asked "Why would you want to do X?"

  • XZ Problem: You ask how to get X to work and you're told to do Z instead.

  • XYZABC Problem: You ask how to do X and after suggesting or getting an answer Y, you get four more alternatives for doing the same thing and no way to choose between them.

  • XYZPDQ Problem: You ask how to do X and after suggesting or getting an answer Y, you get four alternatives that would be more efficient regardless of whether that is important to you or not.

Humor aside, as Not_a_Number said, ++ for giving us an easy way to point someone to their XY Problem.

-xdg

Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

Re: XY Problem
created: 2006-04-10 18:39:41

XYP Problem:

You posted problem X and inquired about solution Y, but it turns out that you spelled it (P)ERL.


___________
Eric Hodges
Re: XY Problem
created: 2006-04-10 22:10:21
Then there's always the XYZ Problem:
They ask how to do Z, but that's because they think they want to do Y and think that Z will get them there, but really it's because they're a lunkhead, and that's the main (X) problem.
Tongue-in-cheek, of course.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Re: XY Problem
created: 2006-04-11 02:12:13
The proscriptive XYZ.

I want to do X and I know you'll all tell me to use Y but I need to use Z. I can't use Y and I'm not going to explain, I have to use Z and I won't explain that either.

update 1: Don't waste your time telling me about Y.
update 2: Look, I have to use Z. Just tell me how to use Z.
update 3: I give up, you're all fools

Hope that helps :-)

Re^2: XY Problem
created: 2006-04-11 10:20:01

wfsp++

Ha! You gave my my first out-loud laugh of the day ... thanks. :) I think I saw an example of an XYZ problem of this nature just the other day, here in PerlMonks. I particularly liked update 3, very clever. Again, thanks.


No good deed goes unpunished. -- (attributed to) Oscar Wilde
Re: XY Problem
created: 2006-05-10 09:59:40
update 2: Look, I have to use Z. Just tell me how to use Z.

Heh. Smells like poorly-designed homework, from a prof who's more interested in following grocery lists of programming "skills" to teach than in actually teaching the skill of good programming.

Re: XY Problem
created: 2006-04-11 11:13:55

Then there is the (thankfully rare) "my problem is X. I've tried Y." then the respondent gives a perfect solution to an entirely different problem.

emc

"Being forced to write comments actually improves code, because it is easier to fix a crock than to explain it. "
—G. Steele
Re: XY Problem
created: 2006-04-11 11:14:35

Completely unrelated to Perl (but still maintaining a modicum of relevance to this thread) is the YYZ Problem: you want to play the drum solo from the Rush song, YYZ, but you aren't (and never will be) Neil Peart. :/

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)
Re^2: XY Problem
created: 2006-04-11 13:44:53
s/drum solo/bassline/;
s/Neil Peart/Geddy Lee/;

bassplayer

Re: XY Problem
created: 2006-04-12 08:24:58
In case you thought this is a new problem you might want to read the first chapter of Jon Bently's book Programming Pearls (0201657880) that was originally published in 1989. In the article Cracking the Oyster discusses this exact problem.

"The programmer's question was simple ... my mistake was to answer his question."

-- gam3
A picture is worth a thousand words, but takes 200K.

perlmonks.org content © perlmonks.org and bassplayer, CountZero, eric256, gam3, jdporter, jeffa, jonadab, merlyn, Not_a_Number, ptum, rhesa, swampyankee, wfsp, xdg, zentara

prlmnks.org © 2006 edmund von der burg (eccles & toad)

v 0.03