News for hackers. Stuff that matters.
Re:The XY Problem (2014) by kentonv on Saturday June 01, 2019 @01:39PM (#20070357)
It's pretty lame that the examples on the page show the answerer not just answering but also talking down to the questioner. XY is a problem that happens a lot, but disparaging people who are trying to learn is not the right response.

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.

Re:The XY Problem (2014) by nullc on Saturday June 01, 2019 @05:02PM (#20071671)
You proposed interaction assumes that the respondent was able to guess the users ultimate goal. That's often only the case on the Nth run-through of the exact same proxy question.

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.

Re:The XY Problem (2014) by Nursie on Saturday June 01, 2019 @01:51PM (#20070423)
This is a great attitude. I tend to approach junior technical staff asking these sorts of of questions with a slightly different tack -

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.

Re:The XY Problem (2014) by sgillen on Saturday June 01, 2019 @01:43PM (#20070379)
I think it is worth telling (politely) the questioner that they really should start by telling people what they really want to do, in order to get better feedback in the future.
Re:The XY Problem (2014) by kentonv on Saturday June 01, 2019 @01:52PM (#20070430)
I think the most polite way to tell them is not to tell them what to do, but rather ask: "Could you give us more background on what you're trying to do? It might turn out we know of an alternative solution that avoids this specific problem."

This doesn't suggest that the questioner did something wrong, but still helps them learn to provide background details when asking questions.

Re:The XY Problem (2014) by Cloudnoob on Saturday June 01, 2019 @02:59PM (#20070845)
But people don't learn or change behavior if they don't understand the issue. In this case, providing polite and constructive feedback would help them ask better questions going forward.
Re:The XY Problem (2014) by phkahler on Saturday June 01, 2019 @03:02PM (#20070863)
I will say something like "can we back up a minute? Why are you trying to do this?" And yes, my second question should be worded differently or spoken carefully to avoid being interpreted as "WTF are you doing?"
Re:The XY Problem (2014) by learnstats2 on Saturday June 01, 2019 @07:24PM (#20072424)
Very often, it's useful to frame a question in a way that someone with specific expertise can quickly help you - 'YY' situations come up all the time.
Re:The XY Problem (2014) by stevep98 on Saturday June 01, 2019 @04:54PM (#20071627)
yes, surely the questioner is trying to balance “doing as much of the work as possible”, and “breaking the problem down into small steps”, versus “give me the answer to my entire problem”

If you ask too broad a question you’re likely to be ignored, imo.

Re:The XY Problem (2014) by learnstats2 on Saturday June 01, 2019 @07:19PM (#20072396)
This is really about two people communicating effectively.

If I saw the original examples happen in the wild, I'd understand the person answering the question to be the problem.

Re:The XY Problem (2014) by emilfihlman on Saturday June 01, 2019 @02:18PM (#20070592)
So

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.

Re:The XY Problem (2014) by dang on Saturday June 01, 2019 @05:15PM (#20071748)
"Please respond to the strongest plausible interpretation of what someone says, not a weaker one that's easier to criticize. Assume good faith."

https://news.ycombinator.com/newsguidelines.html

Re:The XY Problem (2014) by acpetrov on Saturday June 01, 2019 @02:39PM (#20070722)
> People are there to voluntarily give help. They also get loads of really stupid questions and venting does help with keeping them providing help.

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

Re:The XY Problem (2014) by kentonv on Saturday June 01, 2019 @02:56PM (#20070825)
Yeah... no.

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.

Re:The XY Problem (2014) by Waterluvian on Saturday June 01, 2019 @02:51PM (#20070790)
If you're a seasoned veteran here to answer my stupid question and the cost of answering my stupid question is to condescend then PLEASE KEEP WALKING. I do not want your help.
Re:The XY Problem (2014) by emilfihlman on Saturday June 01, 2019 @04:56PM (#20071634)
And I don't want your question?

See how it plays out.

Re:The XY Problem (2014) by Godel_unicode on Saturday June 01, 2019 @11:12PM (#20073229)
You're not that important. If you don't want to answer that's your business, you're allowed to just do nothing.
Re:The XY Problem (2014) by cjaybo on Saturday June 01, 2019 @04:39PM (#20071556)
I disagree with your assertion that the QA community would be worse off if these types of people stopped answering questions. If a person cannot provide a helpful response to a question without being condescending or rude, then I personally think the QA community would be better off if that person reduces the 'help' they are providing.

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.