Skip to main content
Rollback to Revision 14
Source Link

What is it?

The XY problem is asking about your attempted solution rather than your actual problem.

That is, you are trying to solve problem X, and you think solution Y would work, but instead of asking about X when you run into trouble, you ask about Y.. (Variables are interchangeable, literature is inconsistent about which is the problem and which is a solution.)

The problem

This can lead to frustration by people who are trying to help you solve the problem because by the time you ask about it, the solution that you askneed help with might not have any obvious connections to the problem that you are trying to solve.

How to avoid it

To avoid falling into this trap, always include information about a broader picture along with any attempted solution. If someone asks for more information, or especially a more specific question, do provide details. If there are other solutions which you believe will be suggested and which you've already ruled out, then don't try to avoid going over them again – instead state why you've ruled them out, as this gives more information about your requirements and helps others provide better answers.

An example

A recent IRC conversation for illustration:

Q: Is there a function to return a string between two delimiters?

B: I don't understand what you mean, but I doubt there's already a function

C: Split and slice

D: Partition too

Q: I tried partition
Q: I was trying to use built-ins to get the number between something like this in a string "attribute1: 50.223, attribute2: 442.1"

D: Why not just parse the string?

Q: I thought there may have been some built in parsing stuff

D: pairs = [x.strip() for x in s.split(",")]; attribs = {k: v for x in pairs for k, v in [x.split(": ")]}
D: There's a few libraries, but simplistic formats are easy enough -- if you don't care about error handling
D: Changing the source to use a well known format, e.g. json or yaml, is preferred when possible

Q: This code actually comes from HTML
Q: But I don't know how to parse Javascript with HTMLParser or whatever it's called

D: Is it merely embedded in HTML, or some mangled version of HTML?

Q: It's embedded in the HTML

D: If it's JavaScript (and that is, except for missing outer braces), JSON can probably parse it

Q: Thanks

D: I didn't say it explicitly: JSON only parses data structures, not JS code

Q: That's all I need parsed is a data structure

The problem is really about how to parse JavaScript data structures, not find "a string between two delimiters", yet it takes quite a bit of time and intuition to get to the real issue.

This is easier to do in a fully interactive chat (regardless of what mode), but on a SE site, where you polish a post a bit, post it, and then have 5-30 mins, or longer, before feedback, it really helps to head in the right direction from the start.

What is it?

The XY problem is asking about your attempted solution rather than your actual problem.

That is, you are trying to solve problem X, and you think solution Y would work, but instead of asking about X when you run into trouble, you ask about Y. (Variables are interchangeable, literature is inconsistent about which is the problem and which is a solution.)

The problem

This can lead to frustration by people who are trying to help you solve the problem because by the time you ask about it, the solution that you ask help with might not have any obvious connections to the problem that you are trying to solve.

How to avoid it

To avoid falling into this trap, always include information about a broader picture along with any attempted solution. If someone asks for more information, or especially a more specific question, do provide details. If there are other solutions which you believe will be suggested and which you've already ruled out, then don't try to avoid going over them again – instead state why you've ruled them out, as this gives more information about your requirements and helps others provide better answers.

An example

A recent IRC conversation for illustration:

Q: Is there a function to return a string between two delimiters?

B: I don't understand what you mean, but I doubt there's already a function

C: Split and slice

D: Partition too

Q: I tried partition
Q: I was trying to use built-ins to get the number between something like this in a string "attribute1: 50.223, attribute2: 442.1"

D: Why not just parse the string?

Q: I thought there may have been some built in parsing stuff

D: pairs = [x.strip() for x in s.split(",")]; attribs = {k: v for x in pairs for k, v in [x.split(": ")]}
D: There's a few libraries, but simplistic formats are easy enough -- if you don't care about error handling
D: Changing the source to use a well known format, e.g. json or yaml, is preferred when possible

Q: This code actually comes from HTML
Q: But I don't know how to parse Javascript with HTMLParser or whatever it's called

D: Is it merely embedded in HTML, or some mangled version of HTML?

Q: It's embedded in the HTML

D: If it's JavaScript (and that is, except for missing outer braces), JSON can probably parse it

Q: Thanks

D: I didn't say it explicitly: JSON only parses data structures, not JS code

Q: That's all I need parsed is a data structure

The problem is really about how to parse JavaScript data structures, not find "a string between two delimiters", yet it takes quite a bit of time and intuition to get to the real issue.

This is easier to do in a fully interactive chat (regardless of what mode), but on a SE site, where you polish a post a bit, post it, and then have 5-30 mins, or longer, before feedback, it really helps to head in the right direction from the start.

What is it?

The XY problem is asking about your attempted solution rather than your actual problem.

That is, you are trying to solve problem X, and you think solution Y would work, but instead of asking about X when you run into trouble, you ask about Y.

The problem

This can lead to frustration by people who are trying to help you solve the problem because by the time you ask about it, the solution that you need help with might not have any obvious connections to the problem that you are trying to solve.

How to avoid it

To avoid falling into this trap, always include information about a broader picture along with any attempted solution. If someone asks for more information, or especially a more specific question, do provide details. If there are other solutions which you believe will be suggested and which you've already ruled out, then don't try to avoid going over them again – instead state why you've ruled them out, as this gives more information about your requirements and helps others provide better answers.

An example

A recent IRC conversation for illustration:

Q: Is there a function to return a string between two delimiters?

B: I don't understand what you mean, but I doubt there's already a function

C: Split and slice

D: Partition too

Q: I tried partition
Q: I was trying to use built-ins to get the number between something like this in a string "attribute1: 50.223, attribute2: 442.1"

D: Why not just parse the string?

Q: I thought there may have been some built in parsing stuff

D: pairs = [x.strip() for x in s.split(",")]; attribs = {k: v for x in pairs for k, v in [x.split(": ")]}
D: There's a few libraries, but simplistic formats are easy enough -- if you don't care about error handling
D: Changing the source to use a well known format, e.g. json or yaml, is preferred when possible

Q: This code actually comes from HTML
Q: But I don't know how to parse Javascript with HTMLParser or whatever it's called

D: Is it merely embedded in HTML, or some mangled version of HTML?

Q: It's embedded in the HTML

D: If it's JavaScript (and that is, except for missing outer braces), JSON can probably parse it

Q: Thanks

D: I didn't say it explicitly: JSON only parses data structures, not JS code

Q: That's all I need parsed is a data structure

The problem is really about how to parse JavaScript data structures, not find "a string between two delimiters", yet it takes quite a bit of time and intuition to get to the real issue.

This is easier to do in a fully interactive chat (regardless of what mode), but on a SE site, where you polish a post a bit, post it, and then have 5-30 mins, or longer, before feedback, it really helps to head in the right direction from the start.

Clear up confusion with variables
Source Link

What is it?

The XY problem is asking about your attempted solution rather than your actual problem.

That is, you are trying to solve problem X, and you think solution Y would work, but instead of asking about X when you run into trouble, you ask about Y.. (Variables are interchangeable, literature is inconsistent about which is the problem and which is a solution.)

The problem

This can lead to frustration by people who are trying to help you solve the problem because by the time you ask about it, the solution that you needask help with might not have any obvious connections to the problem that you are trying to solve.

How to avoid it

To avoid falling into this trap, always include information about a broader picture along with any attempted solution. If someone asks for more information, or especially a more specific question, do provide details. If there are other solutions which you believe will be suggested and which you've already ruled out, then don't try to avoid going over them again – instead state why you've ruled them out, as this gives more information about your requirements and helps others provide better answers.

An example

A recent IRC conversation for illustration:

Q: Is there a function to return a string between two delimiters?

B: I don't understand what you mean, but I doubt there's already a function

C: Split and slice

D: Partition too

Q: I tried partition
Q: I was trying to use built-ins to get the number between something like this in a string "attribute1: 50.223, attribute2: 442.1"

D: Why not just parse the string?

Q: I thought there may have been some built in parsing stuff

D: pairs = [x.strip() for x in s.split(",")]; attribs = {k: v for x in pairs for k, v in [x.split(": ")]}
D: There's a few libraries, but simplistic formats are easy enough -- if you don't care about error handling
D: Changing the source to use a well known format, e.g. json or yaml, is preferred when possible

Q: This code actually comes from HTML
Q: But I don't know how to parse Javascript with HTMLParser or whatever it's called

D: Is it merely embedded in HTML, or some mangled version of HTML?

Q: It's embedded in the HTML

D: If it's JavaScript (and that is, except for missing outer braces), JSON can probably parse it

Q: Thanks

D: I didn't say it explicitly: JSON only parses data structures, not JS code

Q: That's all I need parsed is a data structure

The problem is really about how to parse JavaScript data structures, not find "a string between two delimiters", yet it takes quite a bit of time and intuition to get to the real issue.

This is easier to do in a fully interactive chat (regardless of what mode), but on a SE site, where you polish a post a bit, post it, and then have 5-30 mins, or longer, before feedback, it really helps to head in the right direction from the start.

What is it?

The XY problem is asking about your attempted solution rather than your actual problem.

That is, you are trying to solve problem X, and you think solution Y would work, but instead of asking about X when you run into trouble, you ask about Y.

The problem

This can lead to frustration by people who are trying to help you solve the problem because by the time you ask about it, the solution that you need help with might not have any obvious connections to the problem that you are trying to solve.

How to avoid it

To avoid falling into this trap, always include information about a broader picture along with any attempted solution. If someone asks for more information, or especially a more specific question, do provide details. If there are other solutions which you believe will be suggested and which you've already ruled out, then don't try to avoid going over them again – instead state why you've ruled them out, as this gives more information about your requirements and helps others provide better answers.

An example

A recent IRC conversation for illustration:

Q: Is there a function to return a string between two delimiters?

B: I don't understand what you mean, but I doubt there's already a function

C: Split and slice

D: Partition too

Q: I tried partition
Q: I was trying to use built-ins to get the number between something like this in a string "attribute1: 50.223, attribute2: 442.1"

D: Why not just parse the string?

Q: I thought there may have been some built in parsing stuff

D: pairs = [x.strip() for x in s.split(",")]; attribs = {k: v for x in pairs for k, v in [x.split(": ")]}
D: There's a few libraries, but simplistic formats are easy enough -- if you don't care about error handling
D: Changing the source to use a well known format, e.g. json or yaml, is preferred when possible

Q: This code actually comes from HTML
Q: But I don't know how to parse Javascript with HTMLParser or whatever it's called

D: Is it merely embedded in HTML, or some mangled version of HTML?

Q: It's embedded in the HTML

D: If it's JavaScript (and that is, except for missing outer braces), JSON can probably parse it

Q: Thanks

D: I didn't say it explicitly: JSON only parses data structures, not JS code

Q: That's all I need parsed is a data structure

The problem is really about how to parse JavaScript data structures, not find "a string between two delimiters", yet it takes quite a bit of time and intuition to get to the real issue.

This is easier to do in a fully interactive chat (regardless of what mode), but on a SE site, where you polish a post a bit, post it, and then have 5-30 mins, or longer, before feedback, it really helps to head in the right direction from the start.

What is it?

The XY problem is asking about your attempted solution rather than your actual problem.

That is, you are trying to solve problem X, and you think solution Y would work, but instead of asking about X when you run into trouble, you ask about Y. (Variables are interchangeable, literature is inconsistent about which is the problem and which is a solution.)

The problem

This can lead to frustration by people who are trying to help you solve the problem because by the time you ask about it, the solution that you ask help with might not have any obvious connections to the problem that you are trying to solve.

How to avoid it

To avoid falling into this trap, always include information about a broader picture along with any attempted solution. If someone asks for more information, or especially a more specific question, do provide details. If there are other solutions which you believe will be suggested and which you've already ruled out, then don't try to avoid going over them again – instead state why you've ruled them out, as this gives more information about your requirements and helps others provide better answers.

An example

A recent IRC conversation for illustration:

Q: Is there a function to return a string between two delimiters?

B: I don't understand what you mean, but I doubt there's already a function

C: Split and slice

D: Partition too

Q: I tried partition
Q: I was trying to use built-ins to get the number between something like this in a string "attribute1: 50.223, attribute2: 442.1"

D: Why not just parse the string?

Q: I thought there may have been some built in parsing stuff

D: pairs = [x.strip() for x in s.split(",")]; attribs = {k: v for x in pairs for k, v in [x.split(": ")]}
D: There's a few libraries, but simplistic formats are easy enough -- if you don't care about error handling
D: Changing the source to use a well known format, e.g. json or yaml, is preferred when possible

Q: This code actually comes from HTML
Q: But I don't know how to parse Javascript with HTMLParser or whatever it's called

D: Is it merely embedded in HTML, or some mangled version of HTML?

Q: It's embedded in the HTML

D: If it's JavaScript (and that is, except for missing outer braces), JSON can probably parse it

Q: Thanks

D: I didn't say it explicitly: JSON only parses data structures, not JS code

Q: That's all I need parsed is a data structure

The problem is really about how to parse JavaScript data structures, not find "a string between two delimiters", yet it takes quite a bit of time and intuition to get to the real issue.

This is easier to do in a fully interactive chat (regardless of what mode), but on a SE site, where you polish a post a bit, post it, and then have 5-30 mins, or longer, before feedback, it really helps to head in the right direction from the start.

Improve formatting.
Source Link
wjandrea
  • 749
  • 4
  • 16

What is it?

What is it?

The XY problem is asking about your attempted solution rather than your actual problem.

That is, you are trying to solve problem X, and you think solution Y would work, but instead of asking about X when you run into trouble, you ask about Y.

The problem

The problem

This can lead to frustration by people who are trying to help you solve the problem because by the time you ask about it, the solution that you need help with might not have any obvious connections to the problem that you are trying to solve.

How to avoid it

How to avoid it

To avoid falling into this trap, always include information about a broader picture along with any attempted solution. If someone asks for more information, or especially a more specific question, do provide details. If there are other solutions which you believe will be suggested and which you've already ruled out, then don't try to avoid going over them again – instead state why you've ruled them out, as this gives more information about your requirements and helps others provide better answers.

An example

An example

A recent IRC conversation for illustration:

Q: Is there a function to return a string between two delimiters?

B: I don't understand what you mean, but I doubt there's already a function

C: Split and slice

D: Partition too

Q: I tried partition
Q: I was trying to use built-ins to get the number between something like this in a string "attribute1: 50.223, attribute2: 442.1"

D: Why not just parse the string?

Q: I thought there may have been some built in parsing stuff

D: pairs = [x.strip() for x in s.split(",")]; attribs = {k: v for x in pairs for k, v in [x.split(": ")]}
D: There's a few libraries, but simplistic formats are easy enough -- if you don't care about error handling
D: Changing the source to use a well known format, e.g. json or yaml, is preferred when possible

Q: This code actually comes from HTML
Q: But I don't know how to parse Javascript with HTMLParser or whatever it's called

D: Is it merely embedded in HTML, or some mangled version of HTML?

Q: It's embedded in the HTML

D: If it's JavaScript (and that is, except for missing outer braces), JSON can probably parse it

Q: Thanks

D: I didn't say it explicitly: JSON only parses data structures, not JS code

Q: That's all I need parsed is a data structure

The problem is really about how to parse JavaScript data structures, not find "a string between two delimiters", yet it takes quite a bit of time and intuition to get to the real issue.

This is easier to do in a fully interactive chat (regardless of what mode), but on a SE site, where you polish a post a bit, post it, and then have 5-30 mins, or longer, before feedback, it really helps to head in the right direction from the start.

What is it?

The XY problem is asking about your attempted solution rather than your actual problem.

That is, you are trying to solve problem X, and you think solution Y would work, but instead of asking about X when you run into trouble, you ask about Y.

The problem

This can lead to frustration by people who are trying to help you solve the problem because by the time you ask about it, the solution that you need help with might not have any obvious connections to the problem that you are trying to solve.

How to avoid it

To avoid falling into this trap, always include information about a broader picture along with any attempted solution. If someone asks for more information, or especially a more specific question, do provide details. If there are other solutions which you believe will be suggested and which you've already ruled out, then don't try to avoid going over them again – instead state why you've ruled them out, as this gives more information about your requirements and helps others provide better answers.

An example

A recent IRC conversation for illustration:

Q: Is there a function to return a string between two delimiters?

B: I don't understand what you mean, but I doubt there's already a function

C: Split and slice

D: Partition too

Q: I tried partition
Q: I was trying to use built-ins to get the number between something like this in a string "attribute1: 50.223, attribute2: 442.1"

D: Why not just parse the string?

Q: I thought there may have been some built in parsing stuff

D: pairs = [x.strip() for x in s.split(",")]; attribs = {k: v for x in pairs for k, v in [x.split(": ")]}
D: There's a few libraries, but simplistic formats are easy enough -- if you don't care about error handling
D: Changing the source to use a well known format, e.g. json or yaml, is preferred when possible

Q: This code actually comes from HTML
Q: But I don't know how to parse Javascript with HTMLParser or whatever it's called

D: Is it merely embedded in HTML, or some mangled version of HTML?

Q: It's embedded in the HTML

D: If it's JavaScript (and that is, except for missing outer braces), JSON can probably parse it

Q: Thanks

D: I didn't say it explicitly: JSON only parses data structures, not JS code

Q: That's all I need parsed is a data structure

The problem is really about how to parse JavaScript data structures, not find "a string between two delimiters", yet it takes quite a bit of time and intuition to get to the real issue.

This is easier to do in a fully interactive chat (regardless of what mode), but on a SE site, where you polish a post a bit, post it, and then have 5-30 mins, or longer, before feedback, it really helps to head in the right direction from the start.

What is it?

The XY problem is asking about your attempted solution rather than your actual problem.

That is, you are trying to solve problem X, and you think solution Y would work, but instead of asking about X when you run into trouble, you ask about Y.

The problem

This can lead to frustration by people who are trying to help you solve the problem because by the time you ask about it, the solution that you need help with might not have any obvious connections to the problem that you are trying to solve.

How to avoid it

To avoid falling into this trap, always include information about a broader picture along with any attempted solution. If someone asks for more information, or especially a more specific question, do provide details. If there are other solutions which you believe will be suggested and which you've already ruled out, then don't try to avoid going over them again – instead state why you've ruled them out, as this gives more information about your requirements and helps others provide better answers.

An example

A recent IRC conversation for illustration:

Q: Is there a function to return a string between two delimiters?

B: I don't understand what you mean, but I doubt there's already a function

C: Split and slice

D: Partition too

Q: I tried partition
Q: I was trying to use built-ins to get the number between something like this in a string "attribute1: 50.223, attribute2: 442.1"

D: Why not just parse the string?

Q: I thought there may have been some built in parsing stuff

D: pairs = [x.strip() for x in s.split(",")]; attribs = {k: v for x in pairs for k, v in [x.split(": ")]}
D: There's a few libraries, but simplistic formats are easy enough -- if you don't care about error handling
D: Changing the source to use a well known format, e.g. json or yaml, is preferred when possible

Q: This code actually comes from HTML
Q: But I don't know how to parse Javascript with HTMLParser or whatever it's called

D: Is it merely embedded in HTML, or some mangled version of HTML?

Q: It's embedded in the HTML

D: If it's JavaScript (and that is, except for missing outer braces), JSON can probably parse it

Q: Thanks

D: I didn't say it explicitly: JSON only parses data structures, not JS code

Q: That's all I need parsed is a data structure

The problem is really about how to parse JavaScript data structures, not find "a string between two delimiters", yet it takes quite a bit of time and intuition to get to the real issue.

This is easier to do in a fully interactive chat (regardless of what mode), but on a SE site, where you polish a post a bit, post it, and then have 5-30 mins, or longer, before feedback, it really helps to head in the right direction from the start.

Commonmark migration
Source Link
Loading
Do not use backticks for anything other than code.
Source Link
Wrzlprmft
  • 28.7k
  • 5
  • 78
  • 153
Loading
Add capital letters
Source Link
Bulat
  • 101
  • 3
Loading
Rollback to Revision 8
Source Link
Loading
Rollback to Revision 7
Source Link
user152859
user152859
Loading
Readability improvements
Source Link
Picachieu
  • 8.9k
  • 4
  • 31
  • 62
Loading
mywiki.wooledge.org is no longer available via HTTP
Source Link
l0b0
  • 1.3k
  • 7
  • 14
Loading
fixed the python example so it actually works
Source Link
KIAaze
  • 101
  • 3
Loading
edited body
Source Link
user102937
user102937
Loading
JavaScript: with a capital "S"
Source Link
AstroCB
  • 3.3k
  • 2
  • 22
  • 34
Loading
Bounty Awarded with 50 reputation awarded by Handoko
replaced google search with yet another useful link
Source Link
kinokijuf
  • 848
  • 4
  • 20
Loading
Added definition that includes X and Y, added headers, reworded description.
Source Link
user164291
user164291
Loading
Post Made Community Wiki
Source Link
Gnome
Gnome
Loading