Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 153 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

Should an answer be down-voted even if it works but it promotes bad practices? Bad practices means it should never be done.

share|improve this question
*looks at this answer that encourages HTML parsing with regex* I downvoted and people asked why. I said it was because regex should never be used with HTML. I even linked to Zalgo, yet the people there still think it's good practice. – Cole Johnson Aug 22 '13 at 0:26
If you downvote an answer because you perceive some deficiency in that answer, then I'd say yes it's a legitimate reason for downvoting. – Old Checkmark Aug 22 '13 at 0:39
@ColeJohnson - over in "this answer" it's good that you soon gave a link to a great explainer why that was bad practice. @ pllee - along that line, agreeing with the two immediate answers below - I'd say down voting due for reasons of 'malpractice' :) should be a learning moment for both the bad answerer and those who follow. For instance, even here, by reading the post Cole Johnson linked to, I learned something about REGEX that I didn't know despite decades of using it. We learn by mistakes - the more mistakes people show us, the better we get at the trade, yes ? – Howard Pautz Aug 22 '13 at 0:48
Does this mean it is legitimate to downvote every answer that uses mysql_* functions? – rink.attendant.6 Aug 22 '13 at 4:44
Who should decide something should never be done? – Danubian Sailor Aug 22 '13 at 7:38
Is it legitimate to downvote every answer that uses DOM parser because I think it is better to use SAX parser? – Danubian Sailor Aug 22 '13 at 9:10
up vote 29 down vote accepted

This is one of those rare occasions where, if you do downvote, it's probably worthwhile to take a moment and explain in a comment why you are downvoting. Otherwise, your downvote will make no sense on an otherwise perfectly good solution to a problem.

Regardless, votes are yours to do with what you wish, so long as you don't use them for abusive practices like serial or sock voting. In general, a good rule of thumb to follow is this: use your vote to express your opinion of an answer's usefulness.

share|improve this answer
Explaining the downvotes is always good. I hate unexplained downvotes. – H2CO3 Aug 22 '13 at 8:16


Downvotes are for wrong answers. If the answer you speak of might work correctly, but should never be used, it is wrong, and should be downvoted. (-3 dims a post so people are less inclined to take notice of it.)

Do leave a comment to explain the problem, though.

share|improve this answer

Should I down-vote an answer that works but promotes bad practices?

Yes, definitely.

"It works" is not enough. (Often, it only appears to be working; something I often encounter when reviewing C or C++ answers is printf("%d", sizeof(TYPE)), which is undefined behavior, but sometimes it seems to work correctly.) An answer should not mislead people. If something "works" in some cases, but due to bad practices in it it won't work in a more general case, it deserves a downvote for sure.

But: the downvote is not for punishment. It would be good to comment as to why you downvoted, i. e. what is wrong with the answer. The ultimate goal is to have the author of the answer fix his code so that it no longer suggests the use of bad practice. If the answer is fixed, remove your downvote.

share|improve this answer
Personally, I think it would be better just to edit the answer to fix the problem. You want printf("%zu", sizeof(TYPE)); That's way more effective than just downvoting because it actually makes the correct answer available to everyone and prevents perpetuating misinformation. Sure, you could hide the correct solution in a comment, but there's no guarantee people will see it. The only possible benefit in a comment is to educate the person who posted the answer. But since people are notified of edits made to their posts, they can still be educated. It also saves bellyaching about downvotes. – Cody Gray Aug 23 '13 at 3:43
That goes for small problems like the one you mention, of course. I'm all for downvoting answers that are massively or irreparably wrong. – Cody Gray Aug 23 '13 at 3:44
@CodyGray Definitely right - we are not even permitted to make edits that radically change contents. – H2CO3 Aug 23 '13 at 5:23
Permitted by whom? That's a case-by-case judgment. I've made many such edits that I think were worthwhile. The goal of collaborative editing is to improve the contents of questions and answers. The reason we have a canned "too radical" rejection reason for suggested edits is so that we can reject edits that change the meaning of posts in an inappropriate way. Adding additional information, links, examples, etc., or fixing mistakes in code samples is all fine. There is no restriction on users with edit privileges doing this. – Cody Gray Aug 23 '13 at 5:27
@CodyGray Recently I've edited an answer that was wrong. It said that "doing XY thing does Z" (or was it "XY thing is right"?) but it was very obviously wrong (it asserted the very opposite of the truth), so I've edited so it said the opposite and now it was correct. Then, the author of the answer rolled my edit back, and told me off arrogantly, stating that "feel free to downvote you f*cktard, but don't change my answer to the exact opposite" (or something like this). – H2CO3 Aug 23 '13 at 5:35

It would be more helpful to provide a separate, correct answer.

share|improve this answer
Agreed, but those two activities aren't mutually exclusive, so this is a non-answer. – Asad Saeeduddin Aug 22 '13 at 4:51
@Asad pllee didn't answer the question which he referenced in the OP, so I was giving him specific advice. – ChrisW Aug 22 '13 at 5:55
@ChrisW I referenced the other answer in my comment. I do agree that it is bad to not offer an explain on the better alternative. – pllee Aug 22 '13 at 13:44
@pllee You did reference the 'other' answer, but you didn't answer the question yourself, and neither did you up-vote the 'other other' accepted answer (which has received no votes in either direction). It's one thing to criticize (and I won't tell you not to) but it would be more constructive if you explained, somewhere, what the better alternative is. – ChrisW Aug 22 '13 at 14:05
I didn't answer the question outright I did say this: Overriding the initComponent on the child instance isn't pretty but it is much better . To me that clearly states the better alternative. – pllee Aug 22 '13 at 14:23

There's a great risk of flame wars with such approach. Consider 2 groups of people, one thinks that A is bad practice and B is good practice, and the second thinks opposite.

In my opinion, it's better to upvote answer you think is better and reserve downvoting for the situations, when the answer doesn't asnwer the question or is not working.

share|improve this answer

You must log in to answer this question.

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