4 ms·
We see good examples of "the problem with StackOverflow" here. The second highest-rated answer is "Evaluate it in a try..catch or whatever your language provid
by fortran77 7y ago
We see good examples of "the problem with StackOverflow" here.
The second highest-rated answer is "Evaluate it in a try..catch or whatever your language provides." and it's justified because "Surely the real question is 'how do I validate a regular expression'."
This is a fascinating computer science question and I'm pretty sure the questioner wasn't asking "how do I validate a regular expression" because he would have asked that.
- sosborn 7y agoPersonally, I think this is a strength of StackOverflow. I think most people read through all of the answers, and this particular one keeps people who know nothing about regex from trying to evaluate regex with regex. And for those with a deeper understanding, they have an answer that provides the intellectual stimulation they are looking for.
- jogjayr 7y ago> I think most people read through all of the answers You're vastly overestimating what most SO users come to the site for. They (and I include myself) just want something that'll work and isn't horrible. Even "not horrible" is something I care about but I know that many devs don't.
- perl4ever 7y agoIf somebody doesn't know the answer to their question in advance, which by definition they don't, it's by no means guaranteed they will know a horrible answer when they see it.
- thereare5lights 7y ago> I'm pretty sure the questioner wasn't asking "how do I validate a regular expression" because he would have asked that. In my experience, people sometimes ask for how to solve the more immediate detail they’re working on rather than the broader problem.
- NieDzejkob 7y agoSee also: the XY problem [0][1]. [0]: http://xyproblem.info/ http://xyproblem.info/ [1]: https://en.wikipedia.org/wiki/XY_problem https://en.wikipedia.org/wiki/XY_problem
- corobo 7y agoThis came up recently. Going to start calling it the XYZ problem https://news.ycombinator.com/item?id=20861806 https://news.ycombinator.com/item?id=20861806 Edit: page refreshed and sure enough the sibling comment calls it out by name Edit2: Called it the XYZ problem: https://cohan.io/the-xyz-problem/ https://cohan.io/the-xyz-problem/
- avar 7y agoIt really doesn't matter what the questioner wanted. The main utility of sites like Stack Overflow is not to give this one person the answer to their specific problem, but to be a useful landing page to people searching for things related to the question later. A lot of those people are novices when it comes to regexes, and it's useful to make it clear that there's some things that are better solved with other tools, even if you can abuse extended regexes syntaxes to solve them.
- mannykannot 7y agoThe answer in this case does not even satisfy that standard.
- mholt 7y agoI also think it's a fascinating question, but if the asker wanted a theoretical answer more than a practical one, it should have been asked on the CS or CS theory stack exchange: https://cs.stackexchange.com/ https://cs.stackexchange.com/ & https://cstheory.stackexchange.com/ https://cstheory.stackexchange.com/
- piedar 7y ago...neither of which existed when the question was asked.
- ridaj 7y agoMaybe the second-ranked answer is trying to second-guess the question, but at least the highest-ranked answer is precise...
- Izkata 7y agoI think it's a more frustrating example: > If so please give example code below. The phrasing, especially combined with what time of year it was asked, makes me think it's a homework question from a CS logic course where they have to provide an example showing the answer is "no", and explain why.