Possible Duplicate:
What motivates people to answer questions in Stack Overflow?

I have spent some time on Stack Overflow mostly answering questions, but also asking some. While I was doing it I've noticed a clear pattern. A lot, if not most of the questions come from newbies that just started to learn programming. For C, more than 50% of such questions are about corrupting the heap by not allocating memory.

I was surprised to see that in each particular case highly skilled developers took their time to explain what the problem is. They haven't just answered "you are writing to a, but you haven't allocated space for it". Normally they have actually written a lengthy answer.

I cannot understand their motivation. Why do they do it?

(I can understand why people write Wikipedia articles. The situation with Wikipedia is however completely different. People write content only once. And do not repeat explaining each newbie that memory should be allocated, and that's why they are much more efficient.)

  • 3
  • 1
    @waiwai933 my question is more about why highly skilled answer obvious newbie questions. but you are right, their might be intersection. – Roman Byshko Dec 3 '11 at 23:35
  • 1
    Helper syndrome mostly. Lazy newcomer questions are also frequently met with downvote rainstorms, and Stackoverflow isn't really intended for language introductions as such. But if worded nice enough, people are just too kind and willing to help out with even the simplest of questions. Expert or not. And reputation greed is widely believed to be the other main motivator. – mario Dec 3 '11 at 23:38
  • Are you suggesting we shouldn't? – Keith Thompson Dec 3 '11 at 23:41
  • @KeithThompson Yes. I would dare to suggest it. It makes no sense, I think. All those question boil down to a proper malloc(). You cannot even google for those questions as they are all different. It would be much more efficient to point students to a wiki page on corresponding topic. – Roman Byshko Dec 3 '11 at 23:52
  • 3
    There's a lot of hyperbole in this question. Starting with the assertion that half of all C questions are about memory management problems. They are not. Ending with it taking an expert to answer them. Nonsense, anybody coding in C for a year knows that answer. Plenty of SO users do. – Uphill Luge Dec 4 '11 at 1:00
  • I also see a huge proportion of "how do I parse this XML" in C# and VB.Net. Every language has similar questions. Can you generalize this question a bit more? What in particular do you consider bad about these questions, and what do you think the appropriate response is to them - close them? Or have a general "here's how memory allocation and pointers and null-terminated strings and buffer overflows and... works" answer that you link them to? – Merlyn Morgan-Graham Dec 4 '11 at 1:08
  • @UphillLuge this was my experience during the last week. As I said, those questions are by students that just started. If you can sort question by reputation then you most surely will see that most of them come from up to 200-300 rep. users. – Roman Byshko Dec 4 '11 at 1:16
  • @MerlynMorgan-Graham Have general answer, or several general answers and also close. – Roman Byshko Dec 4 '11 at 1:17

I can understand why people write Wikipedia articles. The situation with Wikipedia is however completely different. People write content only once.

Yes, well in theory that's the way it should be here as well. Each question and answer will be here in the future to help others just as much as they help the person who originally posted the question. There are of course two problems with this:

  1. Newbies often don't search before asking their question.
  2. People don't close questions as duplicates if they already know the answer. It's often easier to just answer it instead.

If you can point out questions that are exact duplicates of older questions that are already answered, please point it out in a comment, by voting to close the question, or by flagging for a moderator to look at. We would definitely prefer not to have the exact same content duplicated all over the site.

  • They are not real duplicates. Students come with different programs that that (in case of C) almost surely corrupt heap. It is different variable, different function, different assignment, but it almost surely boils down to heap corruption in a most primitive way. – Roman Byshko Dec 3 '11 at 23:39
  • 1
    @LonelyOne Maybe someone needs to write a good tutorial on heap corruption and get it high Google ranking. :) – Bill the Lizard Dec 3 '11 at 23:41
  • Yes, that was actually my idea, to write nice template once and then just plug in corresponding variables... The point is students won't google, because most of them even do not know that it is called heap corruption. The other point is, I got the feeling, that students already somehow realized that SO is the site where the can get answer for free... and actually very good answer. – Roman Byshko Dec 3 '11 at 23:45
  • 2
    I've noticed there are different kinds of dupes. 1) obvious - where the dupe can be found by searching the title. 2) unintentional dupes - where the asker doesn't realize another question relates to his/her problem. 3) questions that are worded differently (good for search) or contain elements that aren't part of the original. 4) not a real dupe. Example: stackoverflow.com/q/7440810/911182. On the surface, the question seems to be a dupe, but the answer reveals that the problem was a misused operator. Had that been closed as a dupe, the asker wouldn't have gotten a proper answer. – Herbert Dec 4 '11 at 0:05
  • 1
    @Herbert Great example. Before we can close question A as a duplicate of question B, then the answers on question B need to actually answer question A. Closing can always be undone, but I always make sure I apply this rule of thumb before merging two questions. – Bill the Lizard Dec 4 '11 at 0:47

By and large I answer questions on Stack Overflow because I want to contribute to the community that has helped me with my real problems at work, and with my side projects.

I don't expect the typical college freshman to really help me with my work problems, even if I help him with his homework problems. But, if he comes to the community for getting his questions answered, chances are he'll stick around for answering what questions he can. Who knows if in two or three years he'll be answering one of mine, or if nothing else, helping other people.

Now the argument can be made that if you're looking for rep, the easy questions are the way to do it. There's lots of them, and the answers are easy to a seasoned developer. The truth of it is these kinds of easy questions, the ones that get lots of upvotes quickly, usually have very important lessons in them. In my opinion the 'easy rep' is justified. Imagine a baseball Q/A site, and someone says "I missed a grounder under these conditions" and someone says "It looks like you didn't put your glove all the way on the ground" - easy solution, lots of upvotes for the person who answers, and the asker walks away with something really, really important.

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