66

Note:

  • This is about a perceived pattern of down-votes.
  • If no such pattern actually exists, this post is moot; if there is such a pattern, I hope the users who contribute to it either reconsider their behavior or engage in a discussion. I'm deliberately not linking to specific posts so as to avoid a distraction. If no one else has noticed such a pattern, so be it - but I wonder if my perception is indicative of an actual problem in the community.

Regexes (regular expressions) - love them or hate them - can offer powerfully concise, if potentially obscure solutions, where appropriate.

However, not every question tagged with calls for an actual regex answer - I'm sure we're all familiar with the XY problem.

Anecdotally, in my personal experience, I perceive the following pattern:

  • Answers to questions tagged that aren't regex-based - whether helpful or not, whether more appropriate than a regex solution or not - are methodically down-voted, without explanation.

  • Note that I am talking about helpful / more appropriate solutions in the primary language context of a given question, not off-topic answers along the lines of "Why don't you do this in language X instead"?

Needless to say, if such a pattern indeed exists, it is counterproductive and should stop.


Update (14 Jan 2023):

The problem affects posts more generally, suggesting a pattern of both aggressively down-voting / closing as a duplicate / deleting questions, as well as seemingly methodically down-voting even answers that do provide regex solutions, on the suspected grounds of the question being subpar / a duplicate / too trivial a variation, as the following posts attest:

24
  • 41
    I've noticed users posting regex solutions to Questions and then added the regex tag themselves :O
    – Scratte
    Commented Oct 28, 2021 at 2:25
  • 3
    Ehh, I have mixed feelings. Why not remove the regex tag if you think the question should not be answered with a RegEx solution?
    – Dharman Mod
    Commented Oct 28, 2021 at 10:12
  • 7
    This is overall a problem with SO. Good engineering demands that we propose the most suitable solution, "staying on-topic" demands that we sometimes hand out sub-optimal solutions. But I don't think there's a way around it, or people would be tempted to post blatantly off-topic solutions. It may be that the OP should actually have asked a more open-ended design question, but then SO isn't a good place either and "software engineering" is a lost cause, so you'd have to take the question outside the SE network.
    – Lundin
    Commented Oct 28, 2021 at 10:55
  • 6
    Yep indeed, I 100% recognize the Behaviour/Workflow described by @OP, it also takes place regularly in the "small" Tag (imacros) I answer..., ... where (for 90% 1-Rep) Users ask a (usually Low Qlt) Qt they think can only be solved with REGEX, tag it with regex, => "annoy" the REGEX Gurus watching that Tag, => get a few Downvotes, I post a simpler Solution that doesn't even use any REGEX. + Those 1-Rep Users usually never follow up (and even less accept Answers, ah-ah...!), and those Qt's then get deleted 30 days later by 'Roomba'...
    – chivracq
    Commented Oct 28, 2021 at 12:27
  • 2
    For one, mere perceptions and gut feelings can be deceiving, whereas concrete data would be factual. Yes, engaging in that research to identify key samples, even if manually, would not only help present the pattern in a non-ambiguous, but also make a stronger claim about its pertinence in the platform.
    – E_net4
    Commented Oct 28, 2021 at 14:43
  • 4
    @E_net4thecurator Hard data is undoubtedly preferable, and I understand that the subjectivity and vagueness of my plea / invitation to a discussion is unsatisfying. But even manual research would ultimately be subjective: how do you prove that a given, comment-less down-vote happened for the reason put forth in this question? So, no, I don't think a convincing case can be built here, only a plea not to engage in a suspected pattern - even though the hypothetical target audience may never see or heed it. nvoigt's answer provides good insights into the potential psychology.
    – mklement0
    Commented Oct 28, 2021 at 15:22
  • 8
    I notice another pattern : There are quite a few complaints for the regex tag, and even though they don't include any "link to specific posts so as to avoid a distraction", they seem to often be linked to a specific user which isn't too hard to find on stackoverflow.com/tags/regex/topusers. Commented Oct 29, 2021 at 11:17
  • 5
  • 2
    Another perfect example of this popped up here even as I was reading this. Normally I'd just leave a comment, but to experiment I posted the correct answer instead of answering what the OP asked for. Social experiment, watch me get down voted to oblivion :)
    – Lundin
    Commented Oct 29, 2021 at 13:47
  • 6
    It's really rather difficult to address this without actual examples, or even a specific theoretical example. I also don't see a convincing argument here that the downvotes you perceive are occurring exclusively because of the regex tag being included on the question, and it's impossible for us to determine that for ourselves without, well, examples. To whit, this question ultimately is just asking users to contour their voting habits to your personal preferences, which I don't think is particularly productive or realistic.
    – TylerH
    Commented Oct 29, 2021 at 13:54
  • 6
    @TylerH, there's nothing to address here. The best this post can hope for is to a describe a perceived pattern of down-voting that is based on formal criteria rather than the merits of answers and plead for it to stop / ask those who do it - if they exist - to discuss. Criticism of this pattern is not a personal preference. As I said: My plea is moot if no such pattern exists; it cannot be proven, but at least anecdotally others have seen it too, as the responses here attest; nvoigt's answer paints a compelling portrait as to what the underlying motivation may be.
    – mklement0
    Commented Oct 29, 2021 at 14:20
  • 2
    i downvote most questions that contains regex related things on the tag i watch becasue most of the time it is uselessly complex and slow.
    – user4466350
    Commented Oct 29, 2021 at 18:29
  • 2
    @EricDuminil I have seen the same thing repeatedly.
    – Mark
    Commented Mar 9, 2022 at 23:26
  • 4
    Quality is in the eye of the beholder. I mean, to some, questions asked on SO seem trivial and are downvoted right away (or closed as a duplicate). Sometimes for good reason, sometimes simply because they themselves follow a different standard. This became so obvious to me that I went from liking to answer/help people on this tag, to staying away in most cases. Frankly put; what fun is it to have your answer downvoted without any apparent reason. I wonder if people downvote answers just because they didn't like the question to begin with. IMHO That's just toxic.
    – JvdV
    Commented Feb 5 at 13:51
  • 2
    I hear you, @JvdV. Anecdotally, I've seen the additional pattern you describe too, especially after duplicate disputes (which too seem to be especially common in the regex tag), and I agree that it is toxic.
    – mklement0
    Commented Feb 5 at 14:14

1 Answer 1

48

Yes, indeed. That kind of answer is called a frame challenge.

For example someone asks how to parse an HTML document using a REGEX and you answer that doing that is a fool's errand and they should use an HTML parser package/dependency of their choice.

Technically, you have not answered their REGEX question. Practically, they got the advice they needed to get, whether they realize it or not.

The problem is, that for every tag (whether it's regex or dungeons and dragons or your favorite pet, it really doesn't matter) there are fanbois. People so obsessed with their favorite solution, that it has become their only solution, to every question. The fact that alternatives exist does not fit into their world view. And they will downvote you, for the perceived heresy of using a different solution to the problem.

It becomes very apparent, when you visit for example the workplace SE. You can post frame challenges. Many answers are. Sure, sometimes people think it's not useful, but you don't have fanbois that downvote you because you did not provide a solution for their favorite tag. I mean I get that. There are no fanbois of German labor law. That stuff is so boring, if you provide an alternative, even people knowledgable in labor law are like "oh, yes, please".

That is the way it should be. Tags are information. This site is about the best solution to a problem.

But you will not get that anytime soon. People are just too attached to things they like. They become irrational. Human even :)

10
  • 36
    Are you suggesting that some of the accounts on this site are operated by humans? That's totally unacceptable, please flag all such accounts as soon as you see them.
    – cigien
    Commented Oct 28, 2021 at 13:51
  • 6
    Practically, they got the advice they needed to get, whether they realize it or not except for all the cases where using a regexp is just fine. This is the issue I have with these kind of answers: they just assume that it's not a good solution because it doesn't cover all use cases, but a lot times you don't need to. I've parsed HTML with regexp and with real parsers. For a one-off, a regexp is just fine, and often easier and faster. If your HTML is predictable it can also be fine for some longer-term solutions (and may avoid a large dependency, which can come with their own problems). Commented Oct 29, 2021 at 6:00
  • 5
    @MartinTournoij How many questions do you see, that go into that much detail that you can know for sure that your solution with REGEX will be just good enough for their scenario? I have never seen such a question. And I would never assume that the tiny glimpse of their program they show in their question or their single data point they post as an example is really all they ever want.
    – nvoigt
    Commented Oct 29, 2021 at 6:21
  • 6
    I just don't assume anything one way or the other, especially since I like questions and answers to be useful in the long term. So I'd answer "here's how to fix your regexp" and then continue with "but there's some downsides with this, and have you also thought about this other solution?" That certainly seems better than going on off on a rant about how it's all "cancer" like that Zalgo regexp answer. Commented Oct 29, 2021 at 7:23
  • 3
    @nvoigt: And I'm tired of seeing this "they should use an HTML parser package/dependency of their choice" argument, linked to the obligatory stackoverflow.com/a/1732454/6419007. The only correct answer is "it depends". If you're sure that the desired info is written with the /\bBlaBla_[A-Z]{3}_\d{5}\b/ pattern, somewhere in the HTML tree, then it's perfectly fine to search the corresponding regex, and make sure that there's exactly one match. Or you could use a huge XML parser library, with a brittle and unreadable XPATH, which will break next time the page design is updated. Commented Oct 29, 2021 at 11:13
  • 2
    Just one example of an answer which proudly claims to be robust because it uses an official HTML parsing library : stackoverflow.com/a/38081155/6419007 Too bad the //a[contains(@href, "twitter.com")] patterns also matches "malicioustwitter.com" or "maliciouswebsite.com/twitter.com". It's possible to write dangerous and brittle code with both regex or HTML parsers. Commented Oct 29, 2021 at 11:35
  • 5
    You can write bad code in any language and with any framework, just as one can crash and burn in any car. It's just a little more likely when speeding on a mountain road compared to driving slowly in the city. Parsing HTML with RegEx is speeding on a mountain road. Certainly the best option under certain circumstances, but not something I would advise people to do when they ask how to get from A to B.
    – nvoigt
    Commented Oct 29, 2021 at 12:56
  • 7
    @EricDuminil There's always nuance, and the merits of a given answer - whether it is regex-based or not - can only be judged individually. I deliberately didn't link to specific answers, as I feared we would get lost in the specifics of discussing their particular merits. My concern is about down-voting based purely on the formal criterion that an answer to a regex-tagged question isn't regex-based. Again, I only suspect that people engage in such behavior, and my post was about describing it as unproductive, to raise awareness and, if someone wants to defend it, to discuss it.
    – mklement0
    Commented Oct 29, 2021 at 14:38
  • 3
    "If the only tool you have is a hammer, every problem looks like a nail" --Some Wise Person
    – Conrado
    Commented Oct 29, 2021 at 18:27
  • 3
    @Conrado: That's true. And it also applies to people who always want to use an HTML parser. Commented Oct 30, 2021 at 19:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .