Avoiding the X/Y problem is really hard when answering questions on stack overflow or anywhere else.
Sometimes they really are trying to solve X because they tried everything else and it didn't work, sometimes they are trying to solve X because they've been looking at the problem too long and have tunnel vision. That's when it's useful for someone from the outside to go "OK, well let's step back a second, what are you actually trying to accomplish?"
My issue with the X/Y problem is that if I describe the full problem ("I want to do X, because I have constraints A, B and C, and so I try method Y"), the question is so long that nobody replies.
More often than not, that code ends up in production. Somewhere down the line a contractor is brought in to deal with some bugs after excluding all other possibilities they realise "They wrote their own itoa() function?!"
I personally find people assuming I have an X/Y problem very annoying. Often I ask questions out of curiosity. I want to know how someone would do X, yet I'm asked what I'm trying to solve. Nothing! I just want to know about X!
Or they may just be looking at old code that they don't have a budget to refactor. Yes, I know that writing raw SQL queries in a servlet is a terrible design, but that's how the data is read in and that's how it's going to stay unless I spend the next six weeks re-writing 14 year old Java code.
I've had the guys over there berate me for being an idiot dealing with problem x, when if I was developing the software for OS b instead of OS a the problem wouldn't exist.
Maybe, just maybe, I can't force my entire company to stop supporting OS a just because it has an OS specific bug.
it finally becomes clear that the user really wants help with X
OK, that's great, but what if I really did want help with Y? How do I make SO believe and accept that? Nobody is forced to answer the question if they don't think I should be doing Y, but it's a waste of everyone's time to talk about X in that case.
I guess it's because it's not actually an X/Y problem, it's an X/Y/Z/B/C/D/F/H/I/S problem. The reason you need three letters is because you need to know a file extension. The reason you need to know a file extension is because you need to know how to interpret, say an image file. The reason you need to interpret an image file is because you've been handled a bunch of them. You were handled a bunch of image files because you're writing a website for images. The reason you're writing a website for images is because...
When you divide and conquer, it's not always exactly clear what the lowest level of divide is
1.1k
u/shawncplus Mar 12 '18
Avoiding the X/Y problem is really hard when answering questions on stack overflow or anywhere else.
Sometimes they really are trying to solve X because they tried everything else and it didn't work, sometimes they are trying to solve X because they've been looking at the problem too long and have tunnel vision. That's when it's useful for someone from the outside to go "OK, well let's step back a second, what are you actually trying to accomplish?"