31

I just wrote an answer to this regex question, which was trying to find numeric strings with or without commas (e.g. 1,234,567.89). I wanted to be thorough because I've seen this problem a lot, both on SO and in real-world code.

When I finished, I found 7 other new answers waiting for me, mostly variations on each other. Which would be fine, except for one thing: They're garbage answers. Unless I'm severely mistaken, every answer but mine (so far) is deeply flawed, and I want to downvote all of them. Yeah, I'm a stickler on regex, but IMHO if your pattern lets stuff like  ...,.,,.,,..9 or even ... pass as "numeric input," then you've failed to meet even the bare minimum requirements.

Enough venting. The reason I'm whining to Meta about this is that I'm about to do something that'll REALLY look like tactical downvoting, and I'm mildly concerned about the consequences. If I answer a question and then rain downvotes on every competing answer, will I get flagged for abuse? That would certainly seem like suspicious behavior to me.

More of an opinion question: At what point does a semi-correct answer deserve a downvote? Obviously, if it were just a typo, I'd edit it myself. Where's the line between "close enough" and "this answer sucks?"

Basically, is it just me? You've seen the question; am I right that these answers deserve downvotes? Seven people thought that [0-9,.]+ was good enough to declare something a number, so why am I the only one who doesn't?


Note: I found some related questions, but nothing that seemed like a duplicate:

Also, as some have noted, my answer ended up pretty long and thorough. I put in a lot of effort because, with all this talk about how the other answers sucked, I wanted to be extra sure mine didn't. I don't expect pages of detail in a normal SO answer.

10
  • 2
    You're advocating using a monster RE that causes brain failure in most readers? It's enough to make me think that Jamie Zawinski was right! Commented May 7, 2011 at 7:18
  • @Donal - My answer is probably overkill. I wanted to be super thorough if I was considering voting down everybody else. My main point is that something like [0-9.,]+ is nowhere near good enough. Commented May 7, 2011 at 12:31
  • Yeah; that's one that's worth voting down. Some of the others were better though. Commented May 7, 2011 at 12:37
  • @Donal I agree. Only two downvotes there are from me, actually. There were a lot of answers that got removed last night, nearly all variations on [0-9.,]+. Commented May 7, 2011 at 12:52
  • 1
    I think we're in agreement that [0-9.,]+ wasn't a solution. :-) Commented May 7, 2011 at 17:05
  • I would not be so hesitant of a downvote. Although the vast majority of us cast much mure upvotes than downvotes, the latter are also needed. It's not that expensive to downvote every now and then.
    – Aleadam
    Commented May 7, 2011 at 23:16
  • 8
    Down voting is a responsibility! If you don't point out the really bad stuff, you're indirectly contributing to it. Make people think twice before posting half-answers and code that will never work.
    – user159834
    Commented May 7, 2011 at 23:25
  • @Justin I fear you now :P As I'm learning regex myself, would you please review this answer I wrote? stackoverflow.com/questions/5958665/… Please, feel free to edit it/downvote me as necessary.
    – Aleadam
    Commented May 11, 2011 at 22:53
  • @Aleadam - Looks like a decent answer, but the question itself isn't all that clear. No need to fear me, I'm not such a huge stickler unless answers are so bad they're downright harmful. Commented May 12, 2011 at 1:55
  • @Justin Of course that was just a joke. Thanks again for taking the time to look at it.
    – Aleadam
    Commented May 12, 2011 at 2:04

1 Answer 1

38

I don't like downvoting.

Get over it. This scenario is more common than you realize, and will continue to be so long as the folks who do know how to differentiate "correct" from "incorrect" withhold their votes.

Seven people thought that [0-9,.]+ was "good enough" to match numbers, so why am I the only one who doesn't?

One of two options:

  1. You're the only one who actually thought it through enough to realize how it could fail.
  2. You're wrong.

Fortunately, it's fairly easy to come up with a simple demonstration that will clearly indicate which of those options is applicable here. I recommend either including that in your answer (best option) or in comments on the many answers you'll be down-voting (meh...)

(Oh, and to address your other, lesser concerns: when it sorta doesn't work, not that I'm aware of, and test it!)


I got called away before having a chance to post this, but I did take a look at the question you use as an example, and most of the answers had a much bigger problem than simply being wrong: their authors had made no attempt to explain why this answer was preferable to one of the eight other answers. What's a poor reader supposed to do? Go through and test every single one? Figure out what it matches and what it doesn't, then decide on their own if that'll work for them?

Well, yes. Initially at least. Fortunately, regexs, especially short ones like these, are fairly easy to test. But once tested, it's important that readers - you included - go back and pick up the slack for the slacking authors: comment on what's matched and what isn't, down-vote what plain doesn't work.

Revisiting the question now, I see that several of the answers have been removed. Those are answers that future readers won't have to evaluate when searching for their solution. SO-style Q&A: 1, forum-style "everything clogs the tubes for eternity": 0.

9
  • 8
    As much as I love downvoting, +1.
    – user27414
    Commented May 7, 2011 at 0:19
  • 1
    You're right. Looks like the signal:noise ratio improved quite a bit, and the asker managed to solve his problem. I guess this question took me by surprise since I'm not used to seeing that many severely flawed answers, and from people who should know better. I was afraid it was me. Anyway, I've put explanations of the other answers' problems in comments and my own answer. Commented May 7, 2011 at 4:13
  • 2
    Why are folks afraid of exercising their downvoting responsibility? I just can't comprehend it, I see people with 2000 votes and only 2-3 downvotes. It's crazy.
    – user159834
    Commented May 7, 2011 at 23:23
  • @Wesley - I've always taken a "safe, legal, and rare" approach to downvoting, and I always remove a downvote if people improve their answer. Having read this and other SO discussions on downvoting, I think I've been much more conservative with them than the majority. I may reevaluate my voting style. Commented May 8, 2011 at 14:01
  • 1
    @Justin Morgan: Down votes are here and they have their place and are quite necessary. There is a certain finesse involved I think, I always place a (hopefully) useful comment, and never write -1, it just makes people sour. Just remember that a down vote is not a personal attack or punishment. It's a way for the community to ensure that misinformation, laziness, and erroneous code gets pushed to the bottom.
    – user159834
    Commented May 8, 2011 at 14:06
  • "SO-style Q&A: 1, forum-style "everything clogs the tubes for eternity": 0." <== This Commented Nov 27, 2015 at 10:51
  • 1
    I'd be interested to know the answer to "If I vote down 7 competing answers on the same question, will I get flagged for vote abuse?" I don't think I've ever thought seven answers on the same question needed downvoting, but I'm fairly certain I can remember four, possibly five. Commented Nov 27, 2015 at 10:53
  • I don't think there's anything special about 7, @T.J.Crowder... I've seen questions that regularly attract the same wrong answer for years; presumably they'll eventually hit 7 wrong answers, and then more. It's not hard to imagine a FGITW situation where 7 wrong answers could be posted almost simultaneously; if that hasn't happened yet, then I assume it's only a matter of time. People email us about this from time to time, and we dutifully investigate; the instances where this is clearly malicious exist, but are vanishingly rare.
    – Shog9
    Commented Nov 28, 2015 at 4:43
  • 1
    @Shog9: "the instances where this is clearly malicious exist, but are vanishingly rare" You mean someone downvoting all the answers on a question (either just to be malicious, or to try to make their own stand out)? If so, it's great news it's rare. (I've only seen every answer downvoted a few times -- and they were justified except on one or two occasions. :-) ) Commented Nov 28, 2015 at 10:52

You must log in to answer this question.

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