What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 134 Stack Exchange communities.

I just noticed on different places that some answers are quite specific to the question that was asked and they have been downvoted because of not covering the more detailed part.

For example, an answer regarding how to split strings was posted. The answer was perfectly right but hadn't considered the rule of "never trust what has been submitted" and the answer was marked negatively.

As I am new to Stack Overflow, what is the standard when you answer a question? Should you include a complete scenario taking into account even the smallest part?

share|improve this question
I don't see a question here. Can you provide 1. an example, 2. what the community did, and 3. what you expected instead? –  Billy ONeal Jun 5 '11 at 9:27
Can you show an example? –  Pëkka Jun 5 '11 at 9:29
I tried to explain in second paragraph what i had seen however i did not keep reference sorry for that –  tejash Jun 5 '11 at 9:30
you can use the "edit" link to add a reference –  Pëkka Jun 5 '11 at 9:31
possible duplicate of Is "Don't do it" a valid answer? –  Jon Seigel Jun 5 '11 at 13:13

2 Answers 2

up vote 18 down vote accepted

A concrete example we can look at in context would be helpful ;p

From the "never trust what has been submitted", I'm reading between some lines - which may be the wrong lines; if this relates to something that could cause SQL injection, for example, then the answer is (IMO) dangerously wrong even if it does exactly what the OP asked. Sometimes the correct answer is "well, you could do this via [blah], but that would be dangerous because [blah]; instead, it is preferable to [blah] because [blah]".

If somebody is asking (without realising it) how to shoot themselves in the foot, then giving them a loaded gun is not the correct answer.

share|improve this answer
+1 for the last paragraph. I wish people would stop handing out those loaded guns though.... –  Billy ONeal Jun 5 '11 at 9:34
Thanks Marc, you are right. Now I am quite clear on situation why those answers had been marked negatively. But I guess these message should be communicated clearly before new user start using system. Reason after that is, if someone just start participating forum, then it's really hard to make sure that your answer is not loaded gun without paying some specific attention on that. –  tejash Jun 5 '11 at 9:38
@tejash - but that applies to most of reality, not just internet-based programming sites. If there is enough context to see that something is a very bad idea, you would say, no? Like "I've got headache that is 4 times worse than the last one I had; last time I took 2 paracetamol and it got better; do you have 8 paracetamol please?" –  Marc Gravell Jun 5 '11 at 9:54
Yes you are right. But that depends on person how he understand some one's advise. Some one asked that he had a headache than you can suggest paracetamol, Normally you will not clarify that do not take 8 paracetamol if its 4 time worse than last time. So for a quick reply you are going to say use text posted through form and you provide some code snippet. But I guess we can not take granted other important items and we should describe importance of validating input or sql injection etc –  tejash Jun 5 '11 at 10:01
@tejash can you show a real life example? –  Pëkka Jun 5 '11 at 10:09
one of example i noticed stackoverflow.com/questions/6241739/… Answer given by Dvir Azulay has been voted -1 before, but now its 0. Have a look –  tejash Jun 5 '11 at 10:19
@tejash actually it is +2-2=0, but that still means that Dvir has gained by posting it. And the comments discuss 2 different potential issues for others to read and decide whether it applies to them. All in all, that looks pretty healthy to me: via the comments, the "it works" is notes, the "but watch for this" is noted, and the poster (Dvir) has net gain.. –  Marc Gravell Jun 5 '11 at 10:25

How to split a string has been asked a bazillion times already. Just answering the question (again, and again) instead of linking to the FAQ, is high risk.

If you do that in the C++ section, and give one of the dangerous C solutions, you really risk your own foot as well.

share|improve this answer

You must log in to answer this question.

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