4

In response to this answer to the question, I took the action of flagging it, as it only provides to tell the OP that what they're doing is wrong, but in no way attempts to provide a useful answer to the question.

Analysis of the answer for the salient points comes down to: -

you most probably are doing it wrong

you didn't understand the mechanism completely

do things as intended you don't need multiple inheritance.

In my opinion, as I have commented on the answer, it should have just been a comment. However, my flagging of the problem has been moderated as 'declined'.

SO's how-to-answer indeed states:

The answer can be “don’t do that”, but it should also include “try this instead”

Isn't an answer more than just stating that something is wrong and should attempt to provide a solution, or at least explain why it is is wrong?

If merely stating "don't do that" is acceptable, that would imply that it would be acceptable to answer every question on SO that way. Is this what we want, or am I missing the point here?

3
  • 2
    As usual, the problem is with the question. It asks for a "best practice", little wonder that an answer shows up that says there is none. Which is a correct answer btw. Somehow this isn't obvious to some C++ programmers so I guess it needed to be said. Be sure to aim your ire. Commented Feb 24, 2016 at 9:37
  • 2
    @gnat, I don't see how that's relevant. A car with square wheels discusses whether or not to make an assumption of the context of a question and answer it as such. In comparison, this is asking if it's ok to just answer with "Your'e doing it wrong" and nothing more. Commented Feb 24, 2016 at 9:49
  • Well, you should include some backup reasoning to explain why the wheels must be triangular. Commented Feb 24, 2016 at 11:29

1 Answer 1

5

"Don't do that" can be a valid answer. It is a better answer if you also include an explanation of what should be done instead. But sometimes, nothing needs to be done instead. If you just stop doing the wrong thing, everything will magically start working again.

Just because an answer says "don't do that" doesn't mean you should flag it as "not an answer." You still have to use your brain—is it actually attempting to answer the question? In most cases, it is.

In this case, it is not. This post makes little to no attempt to answer the question, and even admits as such:

A general answer (without reading through your code in detail)

Making a good-faith effort to answer a technical question at least requires that you've read and understood the code. If you want to provide general, well-meaning advice, then you should post a comment. Nothing wrong with that, I do it all the time. But comments != answers.

Worse, Murphy's answer does not propose a solution to the problem. He basically says, "there's a better way, but I'm not telling you what it is—go back to the drawing board." That is…not helpful. Again, maybe suitable as a comment, but not an answer. Pekka's comment misses this point. It doesn't give the asker a tool or a method or anything at all resembling a solution to his problem.

Beyond the debate of whether or not this is an answer, it certainly is a bad answer, worthy of your and my downvote. It makes rather nonsensical, unwarranted statements like "Qt is quite well designed, and if you do things as intended you don't need multiple inheritance." Since when does "well designed" imply that "you don't need multiple inheritance"? Java called, it wants its snark back.

2
  • 1
    It doesn't give the asker a tool or a method or anything at all resembling a solution to his problem. yeah, I see that now.
    – Pekka
    Commented Feb 24, 2016 at 10:33
  • 2
    An example of a do not do this answer. :-)
    – Cody Gray Mod
    Commented Feb 24, 2016 at 11:12

You must log in to answer this question.

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