I saw this question. It seems pretty clear that it's a relatively new Java programmer trying to learn. Great! This is exactly what SO is about, in my opinion.

Why PriorityQueue in Java cannot have initialCapacity 0?

The problem is - the answers! The top answer is a blind comment dump which doesn't answer the question. I -1'ed it and commented. The answerer admits it doesn't answer the question. Yet, it's the top vote.

The next answer, which suggests using Collections.sort instead of using a PriorityQueue for its sorting abilities alone (and not doing any queueing at all) is barely hanging onto #2. This is the right answer. There's a discussion going on in the comments about efficiency, and it's on the wrong track, too. They're completely missing the insertion cost of adding all the items.

So, I'm terribly frustrated here. As it stands now, I'm afraid this question and its answers are a horrible contribution to the SO community. As it stands, it will only serve to confuse people instead of clarifying the issue.

What can I do? This one's on the wrong track.

  • In my experience, over time, the right answer will become the top voted answer in 99% of cases.
    – Pekka
    Aug 31, 2010 at 19:29
  • 1
    @Pekka: The first vaguely correct answer posted will usually become the top voted answer. That sometimes happens to also be the best answer, but certainly not 99% of the time. I've been on both sides here - posting first answers and getting tons of votes despite not having the best, and posting good answers and not receiving any votes because someone posted some lame answer first that doesn't really answer the question, but the people that vote in the first 30 seconds generally don't read the question either.
    – Mark Byers
    Sep 1, 2010 at 19:48

2 Answers 2

  • Upvote the good answer.
  • Downvote the bad answer.
  • Leave a comment explaining the downvote.
  • Move on and look for other questions you can answer.

You've already done the first three steps. The fourth is the hardest, but sometimes it's the best thing to do. Stack Overflow will never be absolutely perfect and you shouldn't aim for perfection on every question / answer. You certainly shouldn't get yourself frustrated - it's not that important.

If you persist until things are how you think they should be you could end up wasting hours trying to make your point clear against the will of the crowd. In my experience if you can't get your point across in a comment or two then it simply isn't worth wasting more time on it. If the OP has read your comment then that's fine - you've done what you can. He'll see that the top answer is not helpful and select another. If the OP doesn't bother to read your comment it's his own fault.

Think of it like this: you can choose between wasting your time getting into a dispute with fellow Stack Overflowers or you can move on and help several other people solve their problems.


Post a good answer!

Post a good, well worded answer that addresses what the OP is trying to do. Explain in your answer why your answer is better than the others, and why the others are off track. If the OP agrees, he will upvote and accept your answer. Other readers will upvote, too.

The best way to combat a bad answer is with a good one.

  • The right answer is already there. Should I post another? Aug 31, 2010 at 19:21
  • 1
    @Erick - I'm not a java guru so I won't comment on the merits of the answer you're referring to. If you feel it is correct and adequately explained, there's not much else you can do. If you think you could do a better job answering this question, post your own answer.
    – user27414
    Aug 31, 2010 at 19:23

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