DEV Community

Cover image for The XY Problem – How to spot it, solve it, and ask better questions
Adam Greenough
Adam Greenough

Posted on • Originally published at adamgreenough.me

The XY Problem – How to spot it, solve it, and ask better questions

I recently came across the name for a phenomenon that I have been aware of for some time. It’s called the ‘XY problem’.

Wikipedia has a great succinct explanation:

The XY problem is a communication problem encountered in help desk and similar situations in which the real issue, X, of the person asking for help is obscured, because instead of asking directly about issue X, they ask how to solve a secondary issue, Y, which they believe will allow them to resolve issue X.

Wikipedia

I come across this problem a lot; sometimes when talking requirements with clients or offering help online.

Solving the XY problem

An example of a client with an XY problem could be:

Client: I am looking for the best way to convert my webpages to PDF, can you help?

Of course, I can provide the client with a solution to this query (Y) but what are they trying to achieve (X)? I start a polite conversation to discover what the end goal is and ensure I’m coming up with an effective solution.

Client: I would like my visitors to be able to print out my webpages.

Now we know that, we can suggest that most likely a print compatible stylesheet would be much more preferable. Had I not dug a little deeper, the client would have ended up with a bad solution to a reasonable problem.

As we’ve discussed, the same phenomenon can commonly appear on message boards and Q&A sites such as StackOverflow. A user may be asking how to get the last three characters from the end of a string. In PHP, they could use substr() to achieve this. With a little more digging, we could discover that the user would like to get the file extension instead. In this case, the more robust solution could be pathinfo() or some regex.

Careful though, if you suspect you are facing an XY problem, it is rarely a good idea to assume. Doing so could be patronising and annoying. Our example client could have said that the webpages are job applications and they need to be in PDF to send to another system. This would have been a sensible request and an example of why I always have that brief conversation first to make sure we're on the same page.

Asking smarter questions

Even when we know the context, it can be easy to fall into these traps ourselves while searching for answers to problems; particularly so when we are far down the ‘rabbit-hole’ of a potential solution. If you find yourself burrowed, it will often be useful to take a step back and reestablish your end goal.

For some insightful further reading, check out How To Ask Questions The Smart Way by Eric Steven Raymond.

Have you come across this phenomenon in your dev journey on either side of the problem?

Top comments (1)

Collapse
 
adamgreenough profile image
Adam Greenough

Have you come across this phenomenon in your dev journey on either side of the problem?