I notice a lot of answers that are somewhat tangential to the question in hand, especially when the answer goes against best practice.

For example, if somebody asks "Why can't I do something in my table-based layout?", you can answer the 'actual' question (e.g. "You would need to set cellpadding="0"") or solve the user's 'real' problem ("Table-based layouts are inflexible, use CSS instead").

The only times I don't follow that advice are with lax security (because end-users could suffer) or when I suspect somebody is doing something evil ("How would go about laying an invisible link over this?" type requests).

So two questions:

  1. What's the best way of answering such a question? I try to provide the actual answer first, and then caveat it with the best practice method. In addition, I try to question why the user is following the bad practice to begin with.
  2. How should SO be dealing with users who only answer what they perceive to be the user's real problem? To me, it gives a bad experience on SO. Often a user may be aware of best-practice, but is being forced to do something stupid by a pointy-haired boss. Is it valid to flag a user for that, just downvote, respond or ignore?
  • possible duplicate of Is "Don't do it" a valid answer? (also see several questions in the "Linked" section there)
    – sth
    Apr 27, 2011 at 16:34
  • +1 for bringing this up. I hate it when questions about, say, bytecode are answered with "don't bother micro-optimizing, go do something productive" by users who jump to conclusions.
    – Pops
    Apr 27, 2011 at 17:05

3 Answers 3

  1. Your approach is a sensible one. If you're not going to answer the direct question at all, using a comment is better.

  2. Leave a comment on the answer, to the effect that this would be better expressed as a comment since it doesn't directly answer the question, and downvote it.

Do not flag such answers as "Not an Answer," unless they are completely unhelpful. Not an Answer is reserved for things like "Thanks," "Me Too," "Any Update?"

  • Thanks for the advice about when to use flags.
    – Dan Blows
    Apr 28, 2011 at 14:16

I agree with you. Here's why:

  1. It's not all about the OP. Future visitors to the post will arrive from search engines that match the text of the question as asked.
  2. We don't have all the details about the OP's project or intent. If you start assuming things, and make incorrect guesses, then who has your answer helped?

I don't see a problem with saying "in your case, a better idea might be X," but that needs to be an addendum, not a whole answer.


I like to follow the same approach that you do (answer the actual question, but also mention the better approach, and explain why it's better).

I see a couple of different types of answers that only talk about the better approach.

Some folks just say "you shouldn't use table-based layouts, use CSS instead" and that's all. This type of answer really just tells the questioner that they are "wrong", but is not actually helpful. I would downvote that. I wouldn't flag it, personally -- it's a real answer, it's just a bad answer -- unless the answer is actually insulting.

Other folks may refuse to directly answer the question, but actually do provide all of the necessary steps to get from where the questioner currently is to a working solution using the better practice. I think these answers are great; they actually solve the questioner's problem, and also help them improve.

It's true that there may be external reasons why the questioner needs to do it the "wrong" way; I've definitely seen questions where the questioner explicitly says so. But if they don't explicitly say so, I think the "here's exactly how to solve your problem, but using better practice" can be a good answer. (But as I say, it's not the approach I take.)

  • 1
    +1 for "it's a real answer, it's just a bad answer", that actually makes me potentially re-think how I perceive flags for things like that Apr 27, 2011 at 15:57
  • The "it's a real answer, it's just a bad answer" answers that are like "you should use CSS instead", I always just leave them as a comment to the question. They're not really a proper answer to the question, but they should give some guidance as to how the questioner should actually accomplish what they're trying to do.
    – CanSpice
    Apr 27, 2011 at 16:05

You must log in to answer this question.

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