The XY Problem (2014)
xyproblem.info
xyproblem.info
Even though Y was a concrete problem that they do have domain experience in solving!
I call this “going up the rabbit hole.”
——
Example (deliberately shortened from its real depth):
• I’m trying to invent a novel algorithm for inter-procedural data-flow analysis, because none of the existing ones work for me.
• Why? Because I’m trying to reverse a stack machine bytecode with only indirect jumps and no reified CALL/RET opcodes, into a structured inter-procedural control-flow-graph.
• Why? Because I want to do program-slicing to recover HLL representations of key-value-store writes that the program does.
• Why? Because I want to use them as hints for my runtime execution tracer for said bytecode, so it can emit better traces.
• Why? Because I want to put those traces into an OLAP database and I want the data in the DB to be typed.
• Why? Because these traces are the only canonical representation of the state of the system, and our business model is allowing auditors to figure out what’s going on with the system.
Another related type of question is a question born out of curiosity rather than need. Sometimes you want to do things just for fun to see how they work, but you get shut down every time you ask a question because "you should never do that in production".
I start with, "hey, you probably shouldn't do this, but assuming for the moment that you really want to for some strange reason..."
Love it, that’s great! Adding it to my lexicon.
I've simply stopped asking for help with those. IMO there's some point after which it's counterproductive for both parties.
1. The StackOverflow Reflex, where the person responding doesn't believe you've actually explored other solutions sufficiently because in their experience the vast majority of the time the person asking for help hasn't actually explored other solutions effectively. This may feel like bad faith (from either side), but it could just be the asker's inexperience with other solutions that cause them to not apply them correctly.
2. They don't know how to do Y, but they know how to do X really well so they want to make sure you haven't missed anything in your attempt to make X work. Remember that different people have different expertise and may want to try to help solve your problem even if they don't know how to solve it with your chosen solution.
I think askers often don't recognize that explaining why T-X won't work in their case is actually very helpful to fully understand the problem, even if the person helping ends up solving Y directly. If you're asking for help solving a complex problem, sometimes you have to teach the problem to the person helping you. And that's ok.
It was probably as frustrating for them as it was for me.
Heh. Encountered this just the other day. I asked a question about how come an ugly kludge was faster in Python for doing a particular task, and mentioned that I had tested this using timeit and perf.
I got a bunch of answers back that assumed I was doing something stupid that I didn't really need to do. Needless to say, the code samples they posted all ran 5-10 times slower than my kludge, which means they hadn't even tested them.
I ran into this the other day. A person was asking about a Y and when pressed about it that person said the other solutions didn't work. I dug back into that person's history and while they did try a canonical solution - the lacked the ability to debug their efforts.
For context, the Y they wanted to do was essentially to rewrite a core framework in Rails because they didn't understand that an object they were using was nil. Their problem was entirely about how they were getting input from a user form and they wanted to rewrite a framework.
When I pointed it out the person never responded, and I saw a similar question posted by that same person a couple of days later.
Hi, i need $10.
Why? Because I need to buy a beer.
Why? Because the man at the bike shop is super thirsty.
Why is that important? Because If I sate his thirst he said he’d introduce me to his manager.
Why is that important? Because I want to work at the bike store and it’s the only way to get an intro.
“The traces are the only canonical representation of the state of the system”
Why?
But to be pithy, it's because the system is all of:
• intentionally brain-damaged for OLAP, by a design focusing on OLTP efficiency to the exclusion of all else (think: bit-packing structs into k-v values in a way opaque to anything other than the program that owns the values; no binary object-wrapper format like ELF to describe which ISA is in use by a bytecode program; etc.)
• very popular (enough that auditors are interested)
• a competitive mutually-untrustworthy multi-tenant platform, where people have every incentive to obfuscate any sort of event logs their programs emit, so that they can keep the competitive advantage of analyzing those logs to themselves
Or, in short: the system is a scrambled egg, and people are willing to pay to have it unscrambled for them. Most developers would just say "you can't unscramble an egg" and give up. But the schema information is there to recover—it's just burned into the logic of bytecode programs. Someone with the right expertise can recover it.
Where a lot of people commenting on this article are failing, though is thinking only about their needs and what they want. The people responding to your IRC message/ML post/etc are (usually) giving up their valuable time to help others for free, and making some accommodation for this is essential if you want to get anywhere useful.
On top of this, when you join a room/list where you aren't well known, the responders have no context on who you are, your level of experience, etc[0] - but what they DO have is long, long experience with people asking XY questions where Y is both ridiculous and not going to solve X anyway.
I know it's frustrating to have to go through your reasons when you are certain that damn_silly_thing_Y is actually the only way of solving your problem, but it is needed. After all, you're asking these people because they're likely more experienced than you are (or else why ask them?) and thus there's a chance you could be wrong.
0: And you can't often shortcut this - due to astronomically high rates of Dunning-Kruger cognitive bias in many of these venues, starting out with "I'm an expert, I know what I'm doing" without very convincing evidence is usually extremely counter-productive.
My point was the fact that, at the end of the justification chain, you've generally left the domain of expertise of the expert/forum of experts that you came to. Because of this, the people you're conversing with will fail to actually help you with your problem, because they've been dazed/confused/distracted by the higher-level problem statements that exist outside their domain of expertise. Even though the immediate problem is one they're eminently qualified to solve.
It's unintentional nerd-sniping: they force you to tell them about a larger problem that they don't know how to solve—sometimes, in my case, because it's a research problem and nobody knows how to solve it—and they get distracted trying to understand the entire breadth of a topic they may not have ever considered before, in order to figure out how they would solve the highest-level problem themselves. They never "come down to earth" to solve your immediate problem.
It's as if you went to a low-ranking soldier and asked something about how well some body-armor they use works in practice, and they asked you what the context is, eventually demanding you to explain the whole strategy of the war to them, at which point they get confused trying to understand the strategy and politics of the war they're fighting, which is usually inevitable because they're a soldier, not a politician.
If what you're doing is hyper-specialised to your individual environment, there's a very real chance no-one will know the answer. If you put the effort in to explain, in detail, WHY you need this really strange problem, you may get lucky and someone smart and experienced in a closely related field may be around and willing to put in the time to help you. Or not. But you're still going to need to be willing to to in depth into the reasons behind what you're doing or they will likely ignore you.
The lack of response probably isn't because people are dazed and confused, it's probably because your constraints are so restrictive that what you need isn't free IRC help, but a specialist contractor who you're actually paying for their time.
The problem doesn't come because the population I'm asking doesn't know graph theory; it's because someone who's an expert on graph theory can't be expected to also know e.g. DSP design, and the higher-level problem is a DSP design problem, and once they find that out, they say they don't know DSP design and refuse to help. Even though the concrete problem is a graph theory problem!
This is, IMHO, one of the key psychological problems hindering interdisciplinary fields of study: everyone thinks that, because a problem is A&B, and they only know things about A, that they can't make a contribution. Even though everyone only knows either A or B, and the whole point is to get the people who know A talking to the people who know B, rather than to create some sort of A&B paragons.
So getting them to talk to each other often isn't nearly enough - you need a translator in the conversation, or you need to teach them to be more effective communicators.
I just call it "posting on Stack Overflow"
The asker knows that providing the full A-X context would be an utter waste of time, and really does want an answer to Y only.
Certain IRC regs will flat out refuse to answer Y. Often this is because they don't know the answer to Y, but instead of saying so would prefer to wear the mantle of wise interrogator of "things you did not think of"™.
Ofc, sometimes they're talking to a newb and this is appropriate, but jumping to "this is an XY problem" seems to be a knee-jerk reaction for some people.
“I asked my buddy who claims to be a language C expert and he told me that it is completely impossible to accomplish Y using language C, because «invalid reason Q that makes language C sound bad».
Then all of the smug jerks who would usually start by asking what kind of idiot would ever want to do Y will instead fall over themselves to prove that Y is possible and really quite simple to accomplish, and explaining that my expert friend who said it was impossible had no idea what he was talking about.
Make sure to use a pseudonym for this one though if you want to come back to the channel and not have people still mad at you.
Here's how that conversation should have gone:
---
Q: How can I echo the last three characters in a filename?
A: If they're in a variable: echo ${foo: -3}
A: However, if what you really want is to get the file extension, it's probably better to handle extensions of any length. Try this instead: ${foo##*.}
A: That expression says to find the longest prefix of `foo` that matches the given glob pattern, and remove it.
Q: Oh wow! That is actually what I wanted, but it hadn't occurred to me that such powerful pattern-matching would be built into the shell. I already had a solution involving piping through sed, but it was pretty slow and ugly. I noticed that all the files I'm operating on have three-letter extensions and I figured there'd be an easier way to take a slice of a string, since that's a common thing to have built-in. But your answer is the best of both worlds. TIL!
---
There's really no need to admonish the questioner for starting with the wrong question. That won't help. It will only make them afraid to ask questions at all.
This doesn't suggest that the questioner did something wrong, but still helps them learn to provide background details when asking questions.
If you ask too broad a question you’re likely to be ignored, imo.
Q: How can I echo the last three characters in a filename?
A: What is it you're trying to achieve by doing Y? What's the context? You can probably do it this way ... , but let's see if it's a good fit for the problem you're trying to solve.
People are there to voluntarily give help. They also get loads of really stupid questions and venting does help with keeping them providing help.
If your goal is to reduce help, then be my quest.
Ha, imagine hearing this about volunteers at a hospice. SO boards are infinitely less important, but volunteers shouldn't be losing their calm at the same people they're helping
See how it plays out.
If you must vent, vent privately to a friend. If you can't help but vent back to the person asking the question, then please stop answering questions, because you aren't helping.
Very few people have knowledge that is so rare and difficult to obtain that others should endure discouragement (or plain unpleasantness) in order to receive the benefit of their help. And, in my experience, the people who do have that sort of specialized knowledge are often some of the most helpful.
Asking the wrong question wastes both the asker and the answer's time. By all means be kind, but if you fail to take the opportunity to remind someone to be wary of this general problem you are doing both them and yourself a disservice.
If I saw the original examples happen in the wild, I'd understand the person answering the question to be the problem.
"How do you implement a new system call in the Linux kernel?"
"Ah, well, a system call is overkill and leads to compatibility issues, you should try to see whether you cannot solve your problem some other way..."
"My problem is I want to understand how system calls are implemented thus I want to go through all the steps of making a new one so that I don't miss something"
Or, a more recent one from Reddit:
"When will we have desktop computers capable of replicating the feat of Google with AlphaGo?"
"Ah, well, we already have distributed computing trained NNs, also there is some research that it may not require such power..."
"I'm not interested in Go, I'm interested in the power of future computers!"
Seriously, people second-guessing you are annoying.
That's unsettling.
The easiest way out is probably #1, what probably will need the cooperation of some uncooperative 3rd party. It's the correct question, it's just that the answer sucks.
As for an answer, i think something like
cat passwd.txt - | ssh
Might work. Didn't test it though. The cat outputs all arguments in order, and - is stdin.The meta-answer: if it was this easy people wouldn't keep asking about it. For decades now!
When I tried it fifteen years ago ssh insisted on reading the password from keyboard input, not stdin.
SSH reads the password from the terminal, otherwise it couldn't read the password on a piped input
Also, there’s sshpass
Tbqh, without you explicitly stating that you're aware of key pairs and concluded that storing plaintext passwords is the best solution for you, I would excuse anyone who thought that you maybe just hadn't done the research.
Reminded me of this story. I told a co-worker, while we worked on our DB:
- I wish we had the money to run Oracle.
- Are you crazy? Postgres is awesome and perfect for us!
- I know. I'm not saying "I wish we were running Oracle". I just wanted to have the money to do that. :)And? You are the extremely small minority. You need to learn to live with it.
> My problem is I want to understand how system calls are implemented thus I want to go through all the steps of making a new one so that I don't miss something"
These are very different statements, and require different answers. It's like asking "How do I sort a List" vs. "I would like to understand sorting algorithms, what are some resources to start with?".
People second guessing led to what you actually should have asked in the first place.
"Does Django's query builder use prepared statements by default?"
"What are you really trying to do?"
"I'm trying to find out if Django's query builder uses prepared statements by default..."
Not everything is an XY problem. If somebody found that question on SO via Google, they would be pretty annoyed to see it XY'd instead of answered.
Eg,
Me: "What's the best trackball in 2019?"
Crowd: "Do you have RSI? You probably need a vertical mouse."
etc
Why do I want anything? Because I want to be happy and successful, lol.
Is it broad enough now?
Naturally, they didn't read the part at the top where you explain your ultimate goal.
Two days later you make a new post favoring contextual detail over brevity and the same experts pile in to complain that you didn't minimize your example.
I have seen quite a few contractors who didn’t seem to be able to do anything if the environment was not exactly their preferred environment. If you are good you can deliver something in any environment and build up credibility.
Basically it's clan mentality that makes it hard to integrate because they don't transfer knowledge or confidence but authority and rot learning procedures.
Kensington Slimblade, still.
Anyone tried those vertical mice? To me it looks like a pointing device for people with RSI rather than something one may choose for better usability whether they have RSI or not. I was introduced to trackballs by a friend who has RSI, and I loved them, even though I don't have any wrist issues.
This is evident by the examples in the article and the ones in the cited sources. If someone is asking for help, don't try to shame them into explaining what "they really want". What they want is help with a morsel of a problem they ask, nothing more. If it's not the right path to a solution, they will decide, not you.
You're already starting from a toxic situation where asking for help is somehow bad. Besides, you have the same "I know better" attitude in this case, just on the opposite side.
It might get on some nerves to start having to answer "why do you want to do that?" when you're in a siloed culture but eventually people adapt and it just leads to more thought out plans.
Asking why just adds more context and it doesn't need to turn into a second guess of the solution. Its better to breed a culture where asking for context is considered a good thing with no emotional baggage tied to it.
And this isn't helped by the fact that reading internet text generally leads to misinterpretations of the authors intent.
Note, from the article in the second example:
> "Then ASK FOR WHAT YOU WANT!"
Likely, the person who wrote that text was not angry, nor frustrated when writing that, but it very much seems that way to a reader.
For me, at least, a response that solves both X and Y is (if done politely) far preferable to one that only solves Y.
This is a dangerous position to take. I have a junior dev on my team frequently asking for help on Z when X is still a problem. If I actually answer his question, what he puts out is a disaster.'
Like he was having trouble with generating prime numbers. I could have answered his question, but why is he generating prime numbers? Long story short, to create an "optimal" number of threads to insert to a database because inserts were slow and he had 100k to do. Dude. Batch insert. Why are we threading, absolutely not, no. Stepping back Z, Y, X, and V and finding a better solution. 1/10th the code, 1/20th the time, better for the DB.
When you have someone on your team doing things like this, absolutely ask about X.
We get it, sometimes you are asking about X simply because you need to know about X and you know what you are doing.
But often, especially when dealing with more junior engineers, I've found this simple to keep in mind and helpful. It's also a good proof of experience to know when to ask about X and try to make sure you understand the context of the question before answering it.
A special case of Y questions are the overly abstract or general ones. "How do I [solve this kind of problem]?" It's understandable that people try to build up a repertoire of problem solving techniques, but this can be very annoying if the specific X question is simple to answer, whereas the general question is difficult. Sorry to say, but I tend to also ignore questions (I'm thinking of chat rooms) that seem overly general any more, unless I'm in a mentoring mood.
In my day job, I work at BigCorp and I get questions like "how do I Y without Z?" Often, the answer is "you shouldn't Y without Z. In order to have a consistent UX, all BigCorp applications have a policy that Y is done by Z... What is your X?" And then we can talk about if X really is exceptional.
There is a world of difference between a forum like stack overflow where individuals have diverse needs and a forum inside a perscriptive company where uniformity is an engineering or usability booster.
Bonus points, ask y again because the other question answered z only and get it closed as a dupe of the other question.
From my point of view, I'm really not trying to undermine what you're doing, it's a genuine attempt at getting you the best solution.
Here are some examples:
>How do I use apt on Fedora?
>How do I unroll this bash loop?
>How do I multiply this number by 1024 with sed?
I could have a lot of fun answering each question exactly as stated and if you say "I know it's the wrong tool for the job but I'm doing it for fun" that's exactly what I'll do.
However, it turned out that:
>They just wanted to install stuff thinking apt was universal. The better solution was using yum
>Their loop was slow and they had read that unrolling was an optimization. The better solution was reducing the number of subshells spawned
>They just wanted a result, not to implement an integer multiplication state machine in sed. The better solution was using perl/awk
I know some people are jerks about it, and that sometimes you want answers to weird questions. When people do appear to be going down the wrong path though, it would be a disservice to help them do that without letting them know that there's probably a better way.
Sorry for any false positives.
1. It's common for people trying to do Y to ask about X, which is a bad way to accomplish Y. 2. I'm trying to accomplish Z, for which X is a perfectly good option. 3. Every answer on stack overflow for "How to X" is people assuming the XY problem and answering "here's how you do Y instead".
The process of learning k8s and grokking the security concerns in the course of a few sprints is not pleasant. This "XY Problem" crops up all the time, but the devops team is absolutely slammed all the time so many times basic queries go unanswered. Everybody has to help everybody else.
I don't think anyone wants to go back to the days of rigid development infrastructure so we're kind of stuck with devops until the ecosystem can mature.
My great hope is for serverless to take off and so programmers can further specialize. I'm getting tired of learning new languages and stacks every few months or years. Just hand me a biz requirement and let me implement it any way I like.
One of the problems I have with stackoverflow is crafting a question so that only those who have the potential to answer the question will answer it. Unfortunately there are always the folks who want to be first to answer the question and don't understand the fullness of the question and proceed to give a quick, poorly thought out solution. This then keeps others from chiming in.
For example, in one question I was asking about JS array performance and was using bubble sort as just a way to exercise arrays. Immediately I get folks mocking me for using bubble sort -- they completely missed the point of the question.
https://stackoverflow.com/questions/26199420/any-way-to-impr...
OTOH, there are folks who give brilliant answers.
https://stackoverflow.com/questions/36183602/why-is-nodes-ob...
False positives on xyproblem appear to be much more rare and much less harmful than true positives.
At the end of the day a good question provides both context and an indication of things that the asker has tried/learned so far. The person being asked is a person, not an answerbot.
For example, if someone random poses a problem on IRC, the solution to the "real" problem to be solved is NOT the concern or responsibility of the people in the channel. Unless there's a reason to ask for more context, just answer the damn question. Blindly asking the user what they're REALLY trying to solve is taking an intrusive and patronizing attitude. However, if asking will provide helpful context, then that's a valid reason to ask. If the problem as posed seems onerous or contrived, you COULD courteously ask the other person what they're ultimately trying to solve in the spirit of offering to be helpful if the other person so desires, but no one is hiring you do solve the "real" problem for them, so mind your own business.
If a coworker approaches you with a question, similar principles apply, but if you're working on the same project and in the same context, it may be natural to ask about what the larger problem is in a spirit of collaboration, esp. when the questions posed by your coworker smell funny. After all, you both share concerns about a project, though again, this does not give you license to automatically wrest the problem from your co-worker. His ticket, his problem. Your role is advisory.
So, common sense. Don't be one of those doltish know-it-all jerks who like to run the show. Mind the proper boundaries of concern.
Maybe the "presumed solution problem".
Sometimes they are right. Often they are wrong.
Stop making assumptions, people!
XY problems are just the tip of the iceberg; many problems are the result of mistaken assumptions of equivalence, and they often go unstated.
In case 1, you are a beginner. You have an XY question. But you've never heard of an XY question. You also probably couldn't identify your question as an XY question if you had heard of it. Trying to educate people about XY problem is pointless, because beginners don't see it or understand it or have the ability to apply it.
In case 2, you are advanced enough to avoid asking XY questions. You are instead stuck on some esoteric question which you can't resolve by exhausting all your skills. So you post a question on the internet. But you are only asking a question because it is a really hard question. Chances are that most other people cannot answer the question either. So, the only responses you get are people suggesting that you have an XY problem.
I haven't found that to be the case.
Neophytes are perfectly capable of asking questions with a reasonable amount of context: they just need to be taught to do so even when it seems unnecessary to them. Polite explanation to this end works.
> to avoid asking XY questions. You are instead stuck on some esoteric question which you can't resolve by exhausting all your skills. So you post a question on the internet. But you are only asking a question because it is a really hard question.
When you describe the context and the things you've tried so far you will signal to people that you're operating at a level beyond their ability to help.
Asking a high quality question is a universally good move for both newbies and experts alike. It takes more effort, but when you are asking strangers who owe you nothing to put in effort on your behalf it can be a demonstration of good faith to put in obvious effort on your part.
Just give me X or shut up!
The problem is the guy who neither understands X or Y but just has to answer your question.
No mister, I don't care about Z. And I don't have the time to explain the problem in simple words to you. Either give me answer on X or stay out of this thread.
Interestingly, that’s not the case with single-threaded forum ‘discussions’, where the y-answer discussion torches your post.
The Q&A-type really shines in this respect, vs the discussion-forum.
Just have to say, XY happens on Arch Linux forum a lot. High level of knowledge of many users, versus lots of peeps interested to try Arch who know enough to install and generally maintain a Linux system.
I am fine with people asking questions but they first should have built up some credibility.
If that's your attitude, why don't you expect others to think "Just find your own darn answers or shut up!"? :)
When a name I've never seen before on a -users mailing list asks me how to do X -- and X is bizarre -- I assume we have the XY problem.
We have the XY problem because the Internet is full of newbies at any given point, and we've wasted enough attention-span having sixteen-part conversations about how to extract the IP address from ifconfig output* that we'd really like to know if we can skip all that and answer with "Use a dynamic DNS client, don't write your own."
*Don't. Use ip a
...
Use awk.
...
There are an infinite number of guides to awk, but mostly you need to know how it splits strings into fields and prints the ones you specify. How are you planning on handling machines with multiple IPs, by the way?
...
Stop right there. Get a dynamic DNS client.
If this is your work environment you need to make it okay to ask questions, and to dialogue about a problem without shaming the learner. (Really that should be civil behavior in any environment.)
In a private medium, Questioner and Answerer can delve into the wider context and arrive at a well-informed solution.
In public however, any line-of-inquiry is corrupted by its presentation. In the specific context of public Q&A, this means that the motivation of the average answerer is often just to _present_ themselves as knowledgeable without actually being helpful.
In most difficult questions I've seen posted on SO, most answerers have neither an understanding of the context nor the basis with which to compose the "right" answer. Compounding this ignorance is that the Answerer fears losing face and also that he or she is not not personally or deeply invested in the question itself. Thus, a clueless Answerer who accidentally or foolishly interjects in the thread, will eventually default to a simple strategy: negotiating the question.
Less "digging" and more "dumbing", the question is simplified or distorted beyond its original intent so the Answerer can "answer" or rather discount it. They thereby "resolve" their stake in the question posed: giving them (or at least not hurting) the esteem they crave in the larger group. At the very least, they'll have said something and appeared, in their minds, to be just as smart or smarter than the questioner.
StackOverflow's basic design weights against this kind of child's play, since only the Questioner can award the Answerer the checkmark. But I think the more popular Questions still suffer from the transients desperately seeking their ego-fix.
Here's the kind of stuff you find there:
WE CREATE RADICAL NEW TECHNOLOGIES TO SOLVE SOME OF THE WORLD’S HARDEST PROBLEMS
(Why would you solve the hardest problems as opposed to the most valuable ones? Oh well, let's keep going)
How can balloons deliver the Internet to rural and unconnected places?
(I don't know, but are we sure using balloons is really the most sensible solution to that problem?)
How can kites be used to generate electricity in unexpected places?
(I don't know why we'd want to bring electricity in "unexpected places" as opposed to places where it's required, or why kites would be the best solution for that either)
Etc. It's very easy to create very hard problems if you impose unnecessary constraints.
As well as seeming like quite a lot of effort, the fact domains expire means that content probably won't past 2 years unless you fancy keeping paying for the handful of visitors it'll get.
It also helped focus the message by removing all the notion that this is one of many articles on a general tech blog.
Just remember where you are. The XY problem is a far larger problem in a far larger population than HN.
For most questions of the nature each extreme is normally a horrible way to approach it. Something like "You can do it via <method> but there might be a cleaner way to do things depending on what you are trying to accomplish in the end" such as the examples in the page goes miles ahead in being helpful and reduces the overall amount of back-and-forth. This doesn't get a fancy label to reference and articles written about it though as that's just known as a "conversation".
After many years of being dragged down this rabbit hole my first question is now "what makes you think Y isn't working". If the answer is "because X is doing ...", you've just dogged another hours wasted time in another rabbit hole.
I suspect that people are mining data from ("paying attention to") certain posted keywords and then re-posting.
How might I disprove the null hypothesis that people are just repackaging highly voted comments? How might I convince myself that I am wrong or right? Please show your work or cite sources.
- the size of signal: asking a pointed (Y) question saves typing/reading/etc. in some situations - saving the person time and showing that you came to them after some thought (rather than with the original problem)
Asking Y can quickly become about X even if you begin by asking Y.
e.g.
Y: where do I find the foo.bar config value
X: I need to implement feature to _k_
"foo1 on the first iteration, foo2 on the second, etc."
As much as I am a fun of weird little endeavors like programmatically modifying the local scope, my answer is usually along the lines of "...arrays."
Yes, but what do you really want?
You: I want to find a solution to X.
Response: you probably don't want to solve X, but rather W. Here's a solution for W, ...
You: sigh
n00b doesn't actually want the file extensions either, he wants to <insert purpose of the program he's working>.
n00b doesn't actually want <insert purpose of the program he's working> either, he wants not to get fired from his job.
n00b doesn't actually want not to get fired from his job either, he wants to acquire money.
n00b doesn't actually want not to acquire money either, he wants to avoid starvation.
Looks like the answer to "How can I echo the last three characters in a filename?" starts with "Buy some seeds".
Had a friend call me a few months back with a technical problem. "How do I fix Y on my server?"
Now I knew that server wasn't bringing in a lot of money, and the Y he wanted to fix could be accomplished the same way with say, 100 bucks of purchasing something else. But I figured it was better if he figured this out himself.
So I asked him what X he was using it for.
That was it. We never got past that, mainly because he was dead-set on spending a week or two of effort and tens of thousands of dollars on something that was (pretty much) trivial.
So after circling the barn a few times on the phones, I gave up. Told him that yes, based on what he was saying he had a fix for Y that was fine. It was just going to take a long time and cost a lot of money.
"But there has to be a quicker, cheaper way!"
Argghhhh.
Yes, there is. But if you can't figure out that you're solving the business problem first, the technical problem second? There might not be one. Technology exists for a reason, and technical problems exist because business needs are not being met. Fix the business problem. It'll drive the tech decisions.
It was quite a frustrating call. For both of us. The X of the XY problem might be critical. Or not. People who ask dumb questions get dumb answers.
I worked with a really smart leader of a large agency many years ago. Not only a nice guy, he was also brilliant and on top of everything.
I could see several projects he had were going off-the-rails. Why?. Because he kept asking technical questions and getting technical answers. The questions were fine but context-free. The answers were good but context-free.
There was no X. He kept asking Y questions and getting really smart, detailed answers. It was a terrible mess. If you have no context for a technical answer, the only thing an answer is going to do is confuse you.
It's like the old joke about the guys getting lost in a hot air balloon. As they passed over a building, they saw some people on the ground.
"Where are we?"
"In a hot air balloon!"
Now that's a joke, but it hides a truth: without context and a shared language you can get answers all day long to questions and not be any better off at the end than when you started. Probably worse off.