5

I'm new to stackoverflow but I figured I would start helping out the community that's been so helpful to me by answering any questions I can.

One trend I've really been noticing is a lot of people simply code the solution to whatever the person was asking and post it. I've always felt like it's more beneficial to the asker to instead give them hints and point them in the right direction (such as explaining in English how they might do it or provide links to applicable APIs).

So my question is which is the way to go? Should you point the person in the right direction and give them hints or flat out give them the solution to their problem? Does it depend on the context of the question? Is it a bug or are they asking how to implement something?

I'm not really sure...

2
  • 1
    somehow related: meta.stackoverflow.com/q/274652/2140173
    – user2140173
    Commented Nov 17, 2014 at 8:56
  • I don't believe this is a duplicate of the official duplicated question.
    – Mars
    Commented Jul 6, 2017 at 15:42

4 Answers 4

12

I would expect the idea of giving hints instead of complete answers to originate from the notion that SO is a site which exists for people to learn programming. When you are learning to solve problems so that you can eventually solve new problems independently, it is important to not get a complete solution thrown at you as soon as you encounter an obstacle. Otherwise, you'll never acquire the strategies that will lead you to efficiently solve problems on your own.

But SO is a site dedicated to

build[ing] a library of detailed answers to every question about programming.

This is from the tour. The emphasis is mine. What we want are detailed answers, not hints. Whatever learning happens on SO is a side-effect of building the compendium of questions and answers.

9
  • I see what you mean. Thanks for explaining. Same goes to everyone else who answered. Commented Nov 17, 2014 at 3:05
  • 5
    But a detailed answer isn't just providing code to solve the specific problem. That's useful to nobody but the OP (and perhaps not even to them in the long-run). As a matter of principle, I downvote code-only answers. However, if there is full code, but also a good explanation of what's going on and why the code given is the right solution, then I upvote.
    – siride
    Commented Nov 17, 2014 at 3:36
  • @siride - it's not upto you to determine what's useful for the OP.
    – user1017882
    Commented Nov 17, 2014 at 14:39
  • 2
    @DeeMac: yeah, it kinda is, actually. Just handing them a pile of code will be less useful to them than explaining how to solve the problem. The latter course of action will give them knowledge that they can apply in other areas, whereas a code dump solves the problem once.
    – siride
    Commented Nov 17, 2014 at 15:21
  • @siride - read the quote in the post you're commenting on. SO isn't aiming to tutor people. If they ask a specific question and somebody posts a specific enough answer, you shouldn't be downvoting that just because the answer didn't teach the OP some life lessons.
    – user1017882
    Commented Nov 17, 2014 at 16:11
  • 5
    @DeeMac: the goal of this site is to be a repository that is accessible to people other than the OP, and also to be truly helpful to OP. It is not meant to be a "write teh codez for me" site and I will do my part to keep it that way. I also continue to disagree that a code dump with no explanation is of the most value for the OP. That's not the kind of problem-solving I want to be part of, and I hope others agree.
    – siride
    Commented Nov 17, 2014 at 16:21
  • @JayMee - the point of this site is not serve the one but to serve the future visitors as well. We had a too localized close reason at one time for a reason, I still think it is valid.
    – user177800
    Commented May 10, 2015 at 5:30
  • @JarrodRoberson Too localized, in that context, contradicts too broad. Thus, I disagree.
    – user1017882
    Commented Jul 10, 2015 at 15:46
  • you can have a question that is too localized and too broad at the same time, see them every day
    – user177800
    Commented Jul 10, 2015 at 16:52
7

If you look around at some examples of really good answers, they'll typically provide a mix of both. There's no point in being intentionally obtuse with someone - if you've got a concise code example that answers their question, there's no sense in withholding it just to teach them a lesson. However, it's also unhelpful with someone just dumps code, even if it's working code, with no explanation as to what it's doing. The best answers are ones where people can give an appropriate amount of code but also provide what you're talking about - a good, well stated explanation of the "why" behind the "what".

3

Always answer the question. Half answers that only provide hints do not offer lasting value to the community.

Remember, you aren't just answering the question for the user that asked the question, but for the hundreds and thousands of other people who have the same question and come to the site via Google or their search engine of choice. As you hopefully have found, many of your questions are already answered simply because they have been asked before. How would you feel if you came into the site for the first time from Google because you had the exact issue as someone else and you only found a half answer hint? Would you spend time on the site? Would you come back if you saw other highly ranked posts in another search? Probably not.

But before answering, make sure you know what you are answering. Throwing out answers to vague questions is not a great idea. Make sure the question is clear and is on-topic before spending your time answering.

1
  • vote to close as duplicates or other what ever other reasons, never answer vague questions that do not meet the question criteria.
    – user177800
    Commented May 10, 2015 at 5:31
0

Answer the question, then hint at further research.

Let's not get above our stations, StackOverflow is, primarily, a resource for seeking technically specific answers to technically specific questions. It proves beneficial to nobody to leave a question with more ambiguity than what it started with.

Questions that aim to 'teach' the OP because they think they could benefit from researching the answer themselves I'll downvote. It's almost patronising.

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