13

I run into this trivial question.

The OP clearly learns some basics, so I think the best attitude would be to show him the right way and give him some opportunity to think. Is it right?

However, in questions like this, soon many other answers appear, revealing step-by-step, Ctrl+C, Ctrl+V solutions. This makes the "hint answer" completely useless.

So what would be the most appropriate reaction in situations like this? Leave it and let the others answer it? Comment instead?

4
  • You may vote as you see fit (he says at random, with no specific relevance) Nov 28, 2013 at 14:25
  • 5
    But seriously I will often downvote answers which are pure code without any attempt to at least explain why they are doing what they are doing because I consider them not useful. At the very least don't upvote answers you don't approve of Nov 28, 2013 at 14:25
  • Tag it with regex. That is where this kind of question belongs. Has anyone time to close all the "I want to match textual description of a regex" as duplicate of an other question that explains regexp? Nov 28, 2013 at 14:31
  • @JohannesKuhn good idea, but in this particular question I think text parsing is not necessary so I'm not sure about the relevance to regexp
    – Jan Turoň
    Nov 28, 2013 at 14:33

3 Answers 3

8

If you encounter a really trivial question, you will usually be able to vote / flag it as a duplicate.

If not, then see if it's not the case of "minimal understanding" or "too broad" close reason. Note that if the answer can be easily found in language reference / API documentation or similar place, it probably is s case of "minimal understanding".

If that's still not it, and everything else is all right, then answering is perfectly OK.

5

Assumptions:

  • The post is not a duplicate.
  • The "Ctrl+C, Ctrl+V solution" is indeed correct.
  • The post doesn't fall under the "needs minimal understanding" close reason.

This is a tricky situation.

On one hand, the OP is getting exactly what they want - the solution.

On the other hand, we are losing out on our "make the Internet a better place" motto. We want developers to know what they are doing and not be dependent on copy-pasta that they found somewhere.

You wouldn't want to downvote the copy-pasta answer because it's technically correct and solves the problem—but you also don't want another more concise "teaching" (or hinting) answer to have less value.

I think we can agree that just because someone has posted a copy-pasta answer, the better answer that contains more explanations and teachings is still useful to future visitors. We can only hope that the community will recognize the better answer and have it floating close to the top of the page.

The only thing I feel you can do here is leave a comment to the author of the copy-pasta answer explaining to them the rational behind not wanting to just dump working code into an answer. You could also leave a comment for the OP mentioning the existence of a more explanatory answer that might help them understand the root problem.

3

There's been some comments in the other answers already to which I will just add that I believe a good answer explains what the problem is and preferably also provides a solution.

The first one is mandatory, and the second one is optional. If there wasn't any explanation, I would leave a comment to ask for one and usually this request is honored.

What other answers seem to pass by is that your answer is not good either. At the very least it is a link-only answer which is against the rules. You don't link to a solution and you haven't provided an excerpt of it in your answer.

I agree that sometimes a shove in the right direction might be a valid answer, but not in this format.

What I would have accepted as a good answer would be an answer that's somewhere between pseudocode and explanation and that contains links to some appropriate documentation.

  • Check if it's not empty
  • Check if it's numeric
  • Check if the length of the number is equal to X
  • etc., etc.

In fact: would I have had flags left, I'd flag yours for not being an answer. This would be a good comment, but a poor answer.

When answering a question you're not just answering the person that asked it. You're answering it for every person that comes across it. Nudges in the right direction are good comments, but you'll have to give a more concrete answer for me to consider it one.

You must log in to answer this question.

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