18

So, I've been spending considerable more time on SO recently than I normally have, and one thing that I've noticed is quite a few people saying stuff like "There's a Null Pointer Error in this block of code, please help me fix it", with a huge amount of code posted, and no real clue as to where the NPE is. So my question is, what can we do to accomplish 2 goals?

  1. Help the person asking the question become a better programmer.
  2. Help them to solve their problems.
2
  • I guess we can show them standard debugging techniques, and how to actually read the error messages.
    – gen_Eric
    Commented Mar 12, 2012 at 15:33
  • @Rocket: That's pretty much what I'm thinking, see my answer I just posted. Commented Mar 12, 2012 at 15:34

2 Answers 2

18

I think questions like this should simply be closed as too localized, with a link to the faq left in a comment, plain and simple. It's not realistic to expect the Stack Overflow community to hold these developers' hands, teach them how to use the debugger, how to ask a proper question, etc.

Given the volume of questions that comes into SO everyday, I think it's the user's responsibility to learn to be a good questioner, and face an account suspension if he fails to do so. I know that seems mean, but I think we need to focus on keeping the signal to noise ration high, not spoon-feeding every novice developer who happens to also be lazy.


tl;dr

Close the question, and provide the user a link to the faq.

21
  • 1
    -1 A person new to SO would not know about the rules. Why would someone bother reading the FAQ if they plan to only use SO once? I personally think that some people would be put off when their first question gets closed and they are confused as to why. While you are right that we should not "hold their hands," we should point them to good resources so they can learn. If they don't know how to debug programs, they need to learn how. Everyone has to learn somewhere.
    – CoffeeRain
    Commented Mar 12, 2012 at 16:03
  • 1
    @Coffee - you can always leave a comment to a closed question nudging them in the right direction, as well as a link to the faq. In other words, you can close a user's question and guide them in the right direction without being mean to them. Commented Mar 12, 2012 at 16:04
  • 10
    @CoffeeRain 'A person new to SO would not know about the rules' I don't know the rules of an individuals' home when I visit, but I will always pause and check, even if I have to ask, if taking off my shoes is expected. Common sense and courtesy. Commented Mar 12, 2012 at 16:12
  • Agreed, but not voting, as we are neck-and-neck in the rep races. I'm back baby!
    – casperOne Mod
    Commented Mar 12, 2012 at 20:16
  • @casper - hahaha - I noticed that too :-) Commented Mar 12, 2012 at 20:18
  • @casper - TRIUMPH!!!! Commented Mar 12, 2012 at 20:20
  • @Adam-the-meek I've kicked you an upvote just because I know I can keep ahead of you with minimal effort and mod-post-whoring ;)
    – casperOne Mod
    Commented Mar 12, 2012 at 20:20
  • @AdamRackis I could just delete the answer, that would give me a lead... hmmm... Abuse of mod power, or well-executed prank?
    – casperOne Mod
    Commented Mar 12, 2012 at 20:21
  • @casper - I'll take what I can get! Commented Mar 12, 2012 at 20:21
  • @AdamRackis Victory!!!!!
    – casperOne Mod
    Commented Mar 12, 2012 at 20:21
  • @casper - well, if you delete the answer, then I can post a meta question and give you the chance to un-delete and post a rep-whoring conciliatory response. But that was likely your evil plan from the start Commented Mar 12, 2012 at 20:22
  • @AdamRackis Evil, but for all the right reasons.
    – casperOne Mod
    Commented Mar 12, 2012 at 20:24
  • @casper - since you're in such a nice mood, why don't you go let this guy back in the club :) Commented Mar 12, 2012 at 20:25
  • @AdamRackis I'm sorry, I can't do that.... =P
    – casperOne Mod
    Commented Mar 12, 2012 at 20:26
  • @Adam-the-silver-medalist Oh, look at what I'm earning worthless meta rep on today. I don't know that I could be cheaper if I tried.
    – casperOne Mod
    Commented Mar 13, 2012 at 17:00
3

I propose we do the following.

  1. Teach them to use a debugger, and to find what line of code the fault is happening at. There is really no substitute for this, it's almost impossible to fix NPE or similar if you don't know what line of code it happens at. Also teach them other similar methods, what the output means, etc.
  2. Teach them other methods, like figuring out if a variable was initialized by printing the value of it, or similar such.
  3. Help them to understand where to find error messages, and what they mean.
  4. Basically don't answer the question for them, even if the answer is blindly obvious to an experienced user, unless they have pointed to at least a few lines of code where the problem lies. An exception might be made if it's something extremely easy to do, but even this should be discourage.

Here's a few of what I would say are good questions and bad questions. I would say just answer the good ones, but for the bad ones, educate the user in how to better understand their error messages.

Good:

Bad

10
  • -1 "Basically don't answer the question for them...". I strongly disagree with you there - there is no reason that you can't also educate them and also help with their problem.
    – Lix
    Commented Mar 12, 2012 at 15:36
  • 9
    A lot of the time, the error message tells them exactly what the error is, they just need to know how to read it.
    – gen_Eric
    Commented Mar 12, 2012 at 15:36
  • @Lix: The key is to help them narrow the problem. I have no problem if a user says there is a null pointer error or similar in these few lines of code, but if they provide a 100 line function, then it's rather difficult... I've edited to include a few examples of what I would consider good, and what I would consider bad. Commented Mar 12, 2012 at 15:37
  • Difficult? Yes. But if the fact that the question is difficult prevents you from answering then that is a different story. I agree with you about narrowing down the issue but "punishing" a user by refusing to post an answer because he/she does not yet know how to post a good question is bad form (IMHO). Answers and comments on how to improve the question should come hand-in-hand.
    – Lix
    Commented Mar 12, 2012 at 15:43
  • @Lix: I wouldn't call it punishing, but rather helping the user to know how to solve their own problems. Commented Mar 12, 2012 at 15:44
  • By withholding information? I still fail to see how that would ultimately help...
    – Lix
    Commented Mar 12, 2012 at 15:46
  • @lix spoonfeeding comes to mind...
    – yannis
    Commented Mar 12, 2012 at 15:51
  • @Yan - I still can't see anything wrong with killing two birds with one stone. You would help the OP understand the problem by explaining your thought process and how you found the problem and then include a solution as well.
    – Lix
    Commented Mar 12, 2012 at 16:08
  • @Lix Because I'm not here to provide free solutions for people's problems. Although I don't have an opinion on how other people should answer, I feel explaining my thought process and how I found the problem is a sufficient answer.
    – yannis
    Commented Mar 12, 2012 at 16:16
  • 4
    SO has a huge problem with useless search results. Fixing someone's code for them contributes to the problem, since you end up with lots of "why doesn't this code work"-style questions. Fixing their code is actively harmful. Those questions need to be removed, not just closed. Commented Jul 17, 2012 at 0:40

You must log in to answer this question.

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