What is meta? ×

Please note that the homework tag is now officially deprecated. The homework tag should not be applied to new questions and may be removed from old questions.

Can and how does one ask about homework, and what guidelines should members use when responding to homework questions?

Return to FAQ index


migration rejected from stackoverflow.com May 10 at 18:39


closed as off-topic by Gilles, Martijn Pieters, slugster, ProgramFOX, Emrakul May 10 at 18:39



@levhita: Agreed; however, "plz send teh codez" questions should be closed and tagging them as [homework] would similarly be wrong. –  Gnome Oct 6 '10 at 0:32
related: Open letter to students with homework problems "Describe the problem you are having, what your understanding of the problem is and where you are confused. For a question from a student, the best questions are often the ones that are asking how to take a single step in understanding rather than trying to leap all the way to the solution. Realize also that the answer we give may be completely wrong for the path that your instructor is trying to get you to follow..." –  gnat Oct 16 '13 at 6:08

35 Answers 35

This is an attempt to reconcile two extreme positions in a way that is acceptable to the majority of the community:

This post is not the official position of the Stack Overflow administrators, but rather a community-edited effort to provide clear guidelines on how to respond to homework. Individual community members should, of course, use their own judgment.

The guidelines outlined below are rooted in two principles:

  • It is okay to ask about homework. For one, it would be impossible to stop it all even if we wanted to. Stack Overflow exists to help programmers learn and provide a standard repository for programming problems, both simple and complex, and this includes helping students.

  • Providing an answer that doesn't help a student learn is not in the student's own best interest. Therefore you might choose to treat homework questions differently than other questions.

Asking about homework

  • Make a good faith attempt to solve the problem yourself first. If we can't see enough work on your part your question will likely be booed off the stage; it will be voted down and closed.

  • Ask about specific problems with your existing implementation. If you can't do that yet, try some more of your own work first or searching for more general help; your professor is likely to be a better resource at this stage than Stack Overflow.

  • Admit that the question is homework. Trying to hide it will just get the question closed faster. Do not use a “homework” tag, but mention it in the question text if relevant (you can structure your question this way: “How can I do …? I'm trying to do this as part of … which is a homework problem. This is my attempt so far: …”).

  • Be aware of school policy. If your school has a policy regarding outside help on homework, make sure you are aware of it before you ask for / receive help on Stack Overflow. If there are specific restrictions (for example, you can receive help, but not full code samples), include them in the question so that those providing assistance can keep you out of trouble.

  • Never use code you don't understand. It definitely won't help you later (after school, in later assignments, on tests, etc.) and it could be, at best, very embarrassing if you are asked to explain code you turned in.

Answering and moderating homework questions

  • Try to provide explanation that will lead the asker in the correct direction. Genuine understanding is the real goal for students, but trying to provide that is seldom unappreciated for any question.

  • It's usually better not to provide a complete code sample if you believe it would not help the student, using your best judgment. You can use pseudo-code first, and, in the spirit of creating a programming resource, you may come back after a suitable amount of time and edit your response to include more complete code. This way, the student still has to write their own code, but a full solution can become available after the assignment has ended.

  • Recognize that homework is likely to include artificial constraints, and honor those constraints. Also be aware that these constraints may change whether or not a question should be closed as a duplicate.

  • Don't downvote others who answer homework questions in good faith, even if they break these guidelines. It's not always obvious at first glance that a question is homework, especially when you're not expecting to see it here. It is a good idea to suggest editing the response in a comment.

  • Don't ridicule a student because they haven't yet learned something obvious or developed the good habits you'd expect from a seasoned programmer. Do add a respectful comment or answer that points them towards best practices and better style.

  • Don't downvote a homework question that follows the guidelines and was asked in good faith.

  • Don't edit a question to add the tag. The homework tag is deprecated. The homework tag is being actively removed from questions; if you do so, fix everything else that needs fixing (editing, closing or flagging if the question requires it).

  • It's okay to ask if a question is homework, but be polite.

  • As for non-homework questions, questions in the spirit of "plz send teh codez" might be closed as "too broad". Use your best judgment and consider allowing some time (15-30 minutes, at least, is certainly reasonable) for the asker to respond to comments asking for clarification. Remember students are new programmers and often don't yet understand what is expected of them. Help them to get that understanding.

Can you better clarify why a homework question would be closed? I think the argument is that it didn't show enough work in it. Those questions are currently left to down-votes. If it's a poorly written, programming related, on topic question. Why close it? –  Alex B Oct 23 '08 at 17:02
I disagree with the never provide a code sample. You should be able to provide a code snippet, because if somebody finds this via Google, they may have a similar problem and not be doing homework. And the best way to learn is through writing code –  David Basarab Oct 23 '08 at 17:03
@longhorn Perhaps the asker should provide the finished code in an answer? This would also give them a chance to have it peer-reviewed –  Chris Marasti-Georg Oct 23 '08 at 17:05
"If you must provide code, use pseudo-code." Who decide that? If I want to use the language the guy want, I will? –  Daok Oct 23 '08 at 17:10
I'm reminded of the pirate code from Pirates of the Caribbean: "They're more just guidelines, really." Individual members can and will ignore them. –  Joel Coehoorn Oct 23 '08 at 17:26
Perhaps a note that most professional developers were once students themselves, and can recognize the difference between contrived problems that make up homework assignments like classifying animals and real-world problems –  JohnMcG Oct 23 '08 at 17:47
Also: this shouldn't really be seen as a poll. The other viewpoints don't have to out-vote this one to have an impact. All they have to do is together muster enough support so there's no clear winner. If you take the group-think I accidentally created into account they are very close to succeeding. –  Joel Coehoorn Oct 23 '08 at 20:21
I strike two of your rules. Homework is allowed and If I want to answer in C#, I will do it. Who care if it's an homework... it's often less than 10 lines of code, it's not a software... –  Daok Dec 3 '08 at 15:17
For me this represent nothing. People in an homework can request help by checking a book, google, forum or here. It's never the whole homework. I hate to see people bitching against homework, a question is a question. SO is a place to solve question, that's it. –  Daok Dec 3 '08 at 15:47
The suggestions for answering homework questions are excellent. Can these be a little more generalized to also cover questions with the self-study, self-learner, or similar tags? In other words, questions in which the poster who is not necessarily doing homework is looking for guidance in obtaining an answer, rather than a direct answer. –  ssakl Apr 17 '09 at 19:21
I really like these guidelines! However I would not restrict them to homework. The very same guidelines should be stuck to for any questions. Professional programmers need/want/have to learn as much as students do. –  chiccodoro Aug 5 '10 at 15:44
What about the homework tag?. As Jeff posted two days ago (blog.stackoverflow.com/2010/08/the-death-of-meta-tags) the homework tag I believe should also be considered a metatag, and since it is one of the tags that appear in the first page of Stack Overflow I believe it is actually a problem. The use of homework tag shhould be discoureged also. –  Carlos Muñoz Aug 8 '10 at 14:02
I'm not sure I'd consider "homework" to be a meta tag. Unlike other metatags, like "subjective" or "best-practices", "homework" does tell us something about what kind of answer is suitable. "subjective" tells me nothing that isn't apparent from the question itself. "best-practices" is, well, obvious. What question is not about the best way to do something? [homework], like [java] or [wpf] tells me specifically what kind of answers are relevant. I shouldn't answer a [java] question with C++ code, and I shouldn't answer a [homework] question with just the complete code. –  jalf Nov 5 '10 at 15:27
At the very least, meta-tag or not, [homework] provides valuable information to those reading the question, which might not be apparent otherwise. We should recognize that it serves a fairly important purpose. Perhaps that isn't the role of a tag, but then where should it go? Just saying "put it in the question body text" smells too much like "I don't really want to see this information, just tuck it away somewhere", which just gives the wrong idea, since this is actually pretty important information to take into account when answering. –  jalf Nov 5 '10 at 15:30
I love that this an 'attempt to reconcile two extreme positions' by ignoring one of them and laying out guidelines with 'discouragements' for the alternate position. Let's just rename the site 'answers.com' and have done with it. I don't think it's possible to ask a question on SO that's even remotely related computing that one of you won't think is valid. This 'programming resource' is becoming so dilute as to be useless. Let's continue to pander to the lazy and produce a generation of developers who can't write a damn line of code without cut & paste. This is so disappointing. –  Lazarus Nov 14 '10 at 13:19

FWIW, I teach a programming class, and have the following policy:

Programming is a "team sport," and it is good for you to talk with each other about ideas on how to confront the problems, and look to the Internet and other sources for ideas.

Nevertheless, the work you hand in with your name on it should represent work that you did.

If you work with others to complete your lab, list those people with your source code. Also, if you get code from an online resource, list the URL with the lab, and credit where you got the code from. This is a common courtesy and a legal requirement, even for free, open-source software.

Failure to give credit is plagiarism. Work that is apparent plagiarism may receive little or no credit.

You should add a parenthetical: "(<I/Your grader> knows how to use google, too.)" After only a semester of grading Automata homework, it was really easy to separate the googlers from the people who actually did their homework. –  Greg D Oct 23 '08 at 19:11
That's an incredibly lenient policy on plagiarism. My school had an automatic 'zero' for anything that included plagiarism and any cheating was reported to the dean of the college. On a second offense students could be removed from the program. –  jsl4980 Oct 23 '08 at 20:26
Well, where I am is further down in the academic chain such that we see the students as "customers." –  JohnMcG Oct 23 '08 at 20:28
I have to agree with jsl4980. Now it did lead to some interesting problems, I inserted a quotation from SRV into one of my programs and cited it. This lead to my having to explain why I "stole" Java code from a guy who died before Java existed. Neither the prof nor the TA were from the US. –  Dan Blair Dec 3 '08 at 15:58
I like your policy. Programming most certainly is a team sport. –  Chris Ballance Feb 9 '09 at 4:25
Yes, in a literature course, I can use resources, and quote them, and I must cite them and give proper credit. I share your viewpoint in that credit must be given, just as with any other resource. This seems like a guideline to impose on students. –  Anonymous Jun 19 '09 at 6:50
I'm also a computer science professor, and this is similar to my policy as well. As long as they correctly cite something, they can use any source. That being said, if, after they've turned it in, there are so many citations or it's otherwise obvious that most of the work was done by others, I reserve the right to ask them to redo the project from scratch, using what they've learned, but not using so much help this time. It's usually obvious if they misuse this policy, especially if they have a lot of trouble with the same concept on the very next project. They can't hide it forever. :-) –  eruciform Jul 6 '10 at 0:51

I think that helping people with homework is OK, but it seems that not many people agree. I answered a question last night tagged homework. Everyone else in the thread was refusing to answer and providing guidelines that the poster should follow, many of which are echoed here, instead of actually trying to address the issue. That post has now been deleted, most likely through the use of offensive, and most likely successfully caused this user to never visit this site again. This is not the kind of community I would like to see built here. So what if someone posts their homework?

We're here to help people, not to judge them. Remember that.

Doing someone's homework for them is not help, it will hinder them in the long run. Do you want new hires at your company unable to do their own work? –  jsl4980 Oct 23 '08 at 17:09
Who am I to decide what will and won't help people? If I'm able I answer what's asked. If it doesn't help the asker can rephrase and ask again. –  Kyle Cronin Oct 23 '08 at 17:24
I completely agree with you. –  levhita Oct 23 '08 at 17:51
Marking offensive is definitely not cool. –  Joel Coehoorn Oct 23 '08 at 21:04
Oh yes, when I was in collage I had an internship where I had to learn Bash quickly. From the response I got from the Linux community I still avoid Linux whenever I can. This is even though I know that Linux performs better on server side than Windows. There is never call for rudeness. –  WolfmanDragon Dec 11 '08 at 0:27
@jsl4980: There's a difference between answering a homework problem, and doing the student's homework for them. Most homework is too extensive to get ready-to-return code from here anyway, and if the answer is just clarifying the problem, what's the wrong in that? –  Ilari Kajaste Sep 11 '09 at 9:55
I don't think many would have a problem helping a student understand a homework problem or helping out with something that a student stuck on. I draw the line, though, when the homework question is typed in verbatim and the expected answer is a solution to the problem. –  tvanfosson Nov 25 '09 at 13:14
  • There should be no distinction between homework and regular questions. SO community members should answer homework questions as completely and definitively as possible.
  • The "homework" tag is for information only, and should not be used as a guideline for what kind of answers should be given.
  • Conflicts with a school or instructor's policy on outside help are the responsibility of the student asking the question, not the SO community.
I absolutely agree, the "homework" questions are generally still legitimate, beginner type questions and there should be a place SO for beginning programmer's questions and answer, complete with whatever code is relevant to the question. –  Timothy Carter Oct 23 '08 at 21:00
I disagree on this point: a homework question should not be typed in verbatim. Questions about homework: ok. Homework questions as questions: not. –  tvanfosson Nov 25 '09 at 13:11
@tvanfosson: That's no different than non-homework questions. If I typed in the requirements for a paid, non-homework project verbatim ("plz send me the codez") expecting someone to just solve it for me, it would not be okay and should be closed. –  Gnome Apr 20 '10 at 16:03
@Gnome - no argument from me on that, although I suspect it's easier to spot a homework question based on the phrasing. –  tvanfosson Apr 20 '10 at 16:57

Community-based information sources (ex. Wikipedia, Stack Overflow, et al.) all seems to share a prejudice against homework help. It always seems strange to me that this is such a hot issue. If you see a so-called "homework question" you have doubts about answering, just ask yourself this simple question:

"Do I want to answer this question?"

If yes, provide the best and most complete answer you can, without reservation.

If for any reason you don't, simply move on. Don't waste energy making pompous, high-brow, and accusatory remarks about your preceptions of the poster's motivations. It's rude, and degrades the wonderful user-experience that has become Stack Overflow.

  • The poster's motivations for posting are irrelevent

You may think yourself clever that you can identify classes of problems from acedemia vs. professional, but it's possible that someone might be trying to learn independently, or the class might be taken for audit (non-credit). In these cases, "academic honesty" doesn't apply. Furthermore, asking the poster if their question is homework related seems silly. Would you be satisfied if they said "no"? Would a dishonest person answer that truthfully?

  • Stack Overflow is not the place to preach your morals

Even if it's obvious the poster is trying to "cheat" on homework, that's not your concern. The poster assumes all responsibility for their actions. To my knowledge, the party facilitating the "cheating" is never liable for anything. You won't get expelled/fired for helping. After all, you're just answering a question. Nothing more.

  • Dishonest students only hurt themselves

Stack Overflow won't (presumably) be there when the student takes their exams. If the student is smart, they will learn from the answers they get on SO, and will be more prepared for their projects, exams, and long-term career success. The dishonest students will only be helped in the short-term, and won't be serious contenders for good jobs, etc. since they won't be able to apply what they were supposed to learn. Everything comes out in the wash, as the proverb says.

Good answer, even if I don't really agree with it. Where were you to argue this viewpoint when I first posted the question ;) ... –  Joel Coehoorn Mar 17 '09 at 23:30
Recently, an SO user pulled the "this sounds like homework.." bit on a question i asked. Didn't want to start a new thread. I've been out of school since '95, but that's not the point. Point is: you really can't tell if it's homework, and so what if it is? You want the rep points or not? ;) –  Matt Mar 18 '09 at 15:11
Dishonest students hurt more than themselves... If they somehow get into the workforce, they can cause even more damage. –  Raymond Martineau Aug 1 '09 at 5:38

I think helping with homework is great, as long as the asker and answerer are involved in the spirit of learning.

Just providing a straight block of code, with no explanation, isn't helpful.

Ideally the question would be something like, "I have this homework problem and I can't figure out how to figure it out! What should I be looking at?" and the answer would be like, "look at [hash tables, or some website, or this class, or whatever]".

I would hate anyone to feel like their question is too simple, and maybe sometimes it's not obvious that a simple question is really a way of saying, "I don't know how to figure this out."

Then again, for some problems a block of code may even be the best explanation you can give. –  Ilari Kajaste Sep 11 '09 at 9:58

The Stack Overflow model

The Stack Overflow model is:

answer = solution(question)

Some suggest that a better model might be:

if (!ishomework(question))
    answer = solution(question)
    answer = halfsolution(question)

However this is inappropriate for at least two reasons:

  • The ishomework function is particularly buggy
  • Special cases should be avoided when possible (especially when the normal solution is also valid for the special case)

Those that prefer a model which includes the ishomework and halfsolution functions may choose to run the following model in addition to, or in place of, the normal Stack Overflow model:

if (ishomework(question))
    comment = halfsolution(question)

Best Practice

Best practices suggest the following model for all cases:

answer = thoroughexplanation(question) + solution(question)

For example this answer includes a thorough explanation and a complete solution.

+1 Awesome explanation by a programmer for programmers. –  André Caron Dec 3 '11 at 1:49

Distinguishing between homework and other forms of work seems silly in this context. You could make a similar argument that since I am asking questions related to my job, I should CLEARLY MARK those and share my earnings with the answerers. Huh?

Unethical to help people with homework? Silly, silly! If the homework is from college, the person is paying for that homework. Haven't they paid for the right to do it any old way they please? With help from whomever? I should feel LESS guilty for getting help with work I am getting paid for doing?

Everything I've ever learned, I've learned from other people. My whole life is an act of plagiarism, and so is yours! Intellectual property is an illusion, a false construct. We all build on each other's work. –  Marcus Oct 24 '08 at 13:38
Implementing concepts of others is not plagarism, claiming credit for other's productions is. I agree that we should help others with all sorts of problems (the help depends on the question), but I disagree with "My whole life is an act of plagarism, and so is yours!" I learn, not steal. –  Fry Nov 3 '08 at 6:44
@Marcus: We all build on each other's work, yes, but building is not the same as copy/pasting. It's one thing to apply what you've learned from others; it's something else entirely to turn in their work as yoour answer. –  Bruce Alderman Nov 3 '08 at 16:46
Marcus, there's a world of difference between building on someone else's work and passing it off as your own - the latter is plagiarism. –  Anonymous Dec 3 '08 at 15:27

If you want to ask a homework related question you should be upfront about it because

  1. Most people who can competently answer your question do not want to do your homework for you, and particularly do not want to be tricked into doing it for you.
  2. Users answering questions on this site wish to help.
  3. If you are having trouble with homework, usually what you really need is not an answer to the question but rather an explanation of some underlying concept you misunderstand (possibly without realizing it!). That one concept may very well make the rest of your course a breeze!

My thoughts on this:

Overall, I agree with the majority of @Joel Coehoorn's response. That said, I look over the questions I've asked and ... well, damn if just over half of them probably sound like someone else's homework. :) A beginner's guide to bit-shifting? How to use feature x in C? I could easily see someone in a comp sci course asking these same questions. And the SO community was more than helpful for all of them. (Well, all the homework-ish ones.)

The point of us being here is to learn and educate. In just the few short weeks I've been a stack addict, I've learned more than I could ever have dreamed. Am I in school? No. Are my questions truly homework? No. But I'll bet their responses probably helped out some people who were doing homework or other studying. And I have no problem with that!

Do I think we should just send teh codez? No. But I have no problem helping educate someone who's coming into our industry.

So for those of you who are looking for homework help ... Follow the suggestions in the response I linked to in the first paragraph. Most likely, if you're respectful here, you'll get respectful and thoughtful advice from people who've been around the block. For the rest of us ... Well, those guidelines seem perfectly reasonable to me!


Give pointers to help someone on their way to solving the problem. That may include explaining basic programming techniques and best practices along the way.

Never simply provide the answer.

People should come here to learn from answers to homework questions, not simply regurgitate a detailed code sample and hand it straight in.

It's just common sense on the part of the person answering, really. It's a shame some people may prefer posting the working solution as that will increase their chances of their answer being marked 'Answered'.

Isn't this generally a good non-homework policy as well? –  Greg D Oct 23 '08 at 19:12

Agree with the community wiki answer but in addition would like to add that it's not our problem if something is homework. We are building a knowledge-base of programming questions and answers. If the question is the sort that might come up again it should have an answer, that simple. Otherwise we risk becoming too elitist with what are "appropriately nuanced" questions.

Besides, there's nothing stopping a student from claiming to be a professional or a hobbyist, or from going to a different forum even and asking there. In any case, its not like the answer to a technical point will teach them to program, and if it does then so be it, SO educations for everyone!

wnoise, elitism is fine as long as you are in the elitist class. –  WolfmanDragon Dec 11 '08 at 0:39

I work in a computer science department as a graduate student. I live both sides of this coin - as a student and a teacher.

My policy towards my students is- learn what you can, from wherever you can. If you plagiarize, I will fail you, as you have no business passing the course or graduating if you don't know your stuff.


When should we add the homework tag?
Discussion in the comments

An amendment to Answering questions by Joel.

  • Don't assume that a basic question is homework related. If the question is not tagged as homework, but you believe that it maybe homework answer it as such, don't modify the tags or condem the user for asking the question.
I think once the person posing the question has admitted that it is a homework question the tag can be added. –  ShaneB Oct 23 '08 at 18:58
@Joel: When the original poster puts it there, or says it's a homework question. –  Bill the Lizard Oct 23 '08 at 18:58
I've seen questions that are pretty blatant, which is what prompted this whole thing. It seems like there is a point where it makes sense to add the tag. Thoughts? –  Joel Coehoorn Oct 23 '08 at 19:46
I think it's too subjective to just say "this is obviously homework". Give people the benefit of the doubt, and ask for background information if you're not sure. –  Bill the Lizard Oct 23 '08 at 19:50
I agree with Bill the Lizard: Don't ever just assume it's homework. If you're not sure, ask for background information. –  Bruce Alderman Nov 3 '08 at 16:48
What about a `question' that's clearly copy and pasted from a homework assignment, including such idioms as "in this assignment", use of imperative tense, etc? I've seen more than one of those. Surely it's OK to tag as "homework" THEN...? (Of course, that's only gonna catch the most clueless and incredibly lazy askers, but, better than none!-) –  Alex Martelli Jun 17 '09 at 2:28
See also: meta.stackexchange.com/questions/41393/… –  sth May 17 '10 at 22:18
Because of this post blog.stackoverflow.com/2010/08/the-death-of-meta-tags I believe that we now should never use the tag homework. It's a tag that may be considered a meta-tag and also is listed in the first page of tags. Adding the homework tag will probably make the question be closed, unanswered, or just answered with comments like: "We won't do your homework". It may be a legitime question but if it's tagged this way many people automatically will not even try to answer the question. –  Carlos Muñoz Aug 8 '10 at 14:08
  • Stack Overflow is a space for professional developers to ask each other, not for helping students with homework.
  • Questions with the "homework" tag should be immediately closed and deleted.
  • If a user encounters a question that she very strongly suspects is homeowrk, she should apply the "homework" label and close it.
What's the difference between a student looking for help in learning something new and a professional looking for help in learning something new? Learning is learning ... –  John Rudy Oct 23 '08 at 18:55
I disagree completely. A "professional" developer should never stop considering themselves a student. And traditional students often ask challenging and insightful questions that force us "professionals" to learn new ways of looking at things. –  TrickyNixon Oct 23 '08 at 19:15
Every student should find their professor's or school's rules on getting outside answers. If you're turning this work in as your own its blatant plagiarism. Most schools react very severely to any such cheating. –  jsl4980 Oct 23 '08 at 20:02
I have serious doubts that any student would be dumb enough to put their entire homework on SO and ask the community here to do it all. If anything I think that we should do homework; answering the questions of one student could in turn benefit others. Who cares why they need the code? –  EnderMB Oct 23 '08 at 20:24
Believe it or not, it's happened. –  Joel Coehoorn Oct 23 '08 at 20:30
I completely disagree... Where on this page does it say it's for professional developers exclusively? The day you concider yourself better than a student and fully edicated is tha day you should get youself a new career. –  Sakkle Jan 16 '09 at 15:00

You can't complete your homework last minute; Neither can we.

  • Be sure and ask any questions with plenty of time to spare. Having hurt feelings about responses or "teh codez" that didn't come through in time is a misguided feeling; Instead, aim to improve your poor scheduling and motivation skills.

Show us you care enough about your question to care about our answers.

  • By spending time on your question and attempting to solve it, you increase your chances of help. If you spend time carefully crafting your question, we will spend time to carefully answer it. A copy-pasted question from your exam warrants a copy-pasted LMGYFY. Some other things you can do to show us that you care about your question and it's answers :

    • Grammar check!
    • Spell check!
    • Comprehensibility check! From what wrote alone, do you perfectly understand what is being asked and it's context?
    • Formatting check!
  • NonNative English Speakers - If your native language is not English and/or you are incompitent in English, post the question in your native language. If none of us can read your language, we will Google Translate it instead. Asking questions in a non-English language is perfectly acceptable.

Never demand the complete solution.

  • Nor demand that your question be answered in A+ completeness as another question. The community member(s) that answer your question will individually decide their own morality with how much of the solution to answer.

Don't whine or complain about grading or incorrect answers on your exam.

  • Simply put, it's not a real question.
Disagree about the non-native thing. I think that SO is supposed to be english only. –  sixtyfootersdude Jul 21 '10 at 14:34

Do the people on SO consider it cheating to post questions here asking for help on homework?

Does anyone consider it cheating to ask for help on a project you're being paid for?

Does anyone write a complete program in their answer anyway? Isn't it normally pseudocode or an excerpt anyway?

And what if you can get someone to write your programs for you? Isn't there normally an exam where SO isn't available?

I think posting answers to homework-like questions should be just like posting answers to non-homework questions. Answer it as clearly as you can if you know the answer. Don't answer if you don't know. Post helpful links.

The purpose of this site is to educate other people, and to learn from other people. If we provide only hints and partial answers to any question, rather than disclose our actual knowledge, then we've circumvented the benefits of this site for all involved.

The more code you write, the faster you learn. To write code faster and thus learn faster you have to ask questions and see examples. The example isn't useful if you don't use it for something, but students and professionals both learn the same way. –  Mnebuerquo Oct 23 '08 at 18:09
It seems to me that the issue is the difference between "examples" and "answers". Certainly we all learn from other people's code, even if we copy it verbatim ... but I don't know how much we learn if our involvement is strictly ctrl-C and ctrl-V (or your local variant). –  Dave DuPlantis Oct 30 '08 at 19:12

The way I see it, the real problem is not homework questions, but plzsendtehcodez questions.

There's no reason a homework question should be treated any differently than a beginner's question. It's not our responsibility to prevent the student from getting in trouble, or make sure s/he learns something. These are the student's responsibilities.

If the original poster is obviously not interested in learning anything and just wants the code, this makes the question a plzsendtehcodez question, which I think should be closed immediately. They're both annoying and disrespectful (both to computer science and SO users).


Consider, also, that a professional developer may be doing "self-study", working her way through a textbook which may, in fact, be commonly used in a university course. Such a person would not have the resources of a university student (professors to ask, tutoring, etc.), and may come here to ask a question.

How do we differentiate that from homework? Do we? Should it be tagged "homework"?


I don't believe that the "homework" tag is necessarily the relevant point. The major difference, which is highlighted by the "plzsendtehcodez" tag.

If a student has a homework question, or someone has posted a Project Euler question, then the community SHOULD NOT answer them. The purposes of these things are self growth, and the Stack Overflow community is not a place where work should be farmed out to.

If a question is posted "Design this website for me" there would be a community backlash against that poster. The poster is offloading their responsibility to find an answer on to other people.

If, however, the poster has clearly tried to find an answer for themselves. Or if their question is a fine-grained specific part of their homework, then we should absolutely help. This is the place to find answers for problems that have you stumped, but it's not a place to have other people do the work for you.

I think the question: "How should I start to design a webpage" would be ok too. Questions don't nessesarily need to be fine grained although they need to be either fine grained OR where should I start to do X. –  sixtyfootersdude Jul 21 '10 at 14:30

I think this exact same question should be posed to the professors/teachers of the classes you are in. You can probably get answers here, but if your professor found out you didn't do the work yourself you will most likely receive a failing grade. Many schools take cheating incredibly seriously, so make sure you know what you're getting in to before you decide to ask for help on here.

Since when asking for help is wrong?, half of our every day jobs are searching in Internet how to do this or how to do that. If I had to know everything by memory when I code, I would probably make horrible mistakes. I think even code samples are cool, after all you'll never post a full scripthere –  levhita Oct 23 '08 at 17:28
"Ask your professor" I Am a Professor and I don't consider as cheating to research a possible solution in SO, actually I presented this site to my students. –  levhita Oct 23 '08 at 23:13
Since when is research cheating? A student will inevtably come to a point where he or seh is stuck on a problem. Not beeing able to ask for assistance in one way or the other seems iverly rigid and would in my opinion strongly lessen the learning potential. I'm glad my teachers allowed this... –  Sakkle Jan 16 '09 at 14:56

I think it's extremely important for students to learn that real-world programmers work together, learn from each other, support each other, and share their knowledge and insights. It's this type of networking that inspires and excites us.


Homework, especially computer science homework, is a process not a goal. By not fully participating in the process, you are hurting yourself. Asking for help is fine, but it is only a small part of the process.


A question is a question. It doesn't matter if it's homework or not.

Give a straight-up answer to the question and then walk the person through it if they ask for help understanding the answer.

We should never assume that the person is just going to take the code and run with it without understanding it. That may happen, but let's not ruin it for those that really want to learn.

Some people are so picky about even giving example code to show an idea of how to solve a homework problem. It's sickening.

As for tagging something as homework, that might be a bad idea if everyone is going to treat the person like crap. If not though, the tag would be useful information as it might give you a hint to be a little more specific when answering.


A good answer here would be the one that explains the theory, some caveats and provide an code sample (usually barely working(if working at all)) that with some work can become in a full application.

That apply for students, professionals and hobbyist.

Making a distinction for Students will only make that in the future when a professional look that question, will find a crippled answer.

Lets don't make distinctions, knowledge shouldn't be limited to anyone.


Personally, I don't think it matters. Either way, answers should be written so that people learn something, regardless of if they're students or professional developers. I think it's OK to give solutions to homework questions so long as the student comes away learning something, however, us programmers are damned lazy, so if a solution is posted there's the temptation to simply blindly copy and paste it. This is the same for questions asked by professional programmers too however (and in fact, I'd argue that it's not very professional to copy and paste anything you don't understand).

So, I say treat them all the same, but also write answers to TEACH instead of to simply give the solution. Teach a man to fish and all that.


As far as I have experienced, Stack Overflow will make one learn, the same purpose as homework.


One point a lot of the answers seem to miss is that sometimes you get a professor who is no help at all, and the students have to figure out everything on their own. I've been in that situation and always appreciated any help I could get.

I will answer homework questions like any other questions.

Thank you for this answer. You have just solved my moral dilemma. I too have been in college classes where the faculty paycheck recipient deliberately minimized the learning process to the furthest extent possible. –  User.1 Feb 11 at 17:21

The first answer seems pretty well supported, but as expected there are a number of people who disagree with the ideas outlined there: both in the comments and in other answers. Like it or not, the very existence of the dissenting viewpoint proves that this faq question is needed.

However, none of the other answers yet address all the issues. They are mainly a response to the content of the original answer. We could really use an opposing response, written in the sofaq/community-wiki style, that addresses the original question directly. Then people could vote for it and we would have a better idea where the community stands.


You know, I instinctively baulk at the obvious homework questions. Perhaps it's because someone is getting a grade for it, so I feel it should be original work.

But, it occurs to me that I initially learned how to program from the ages of 11 to 12 about 95% from copying other people's programs from magazines (admittedly my buddy and I spent a lot of time tweaking and modifying them). By 13 I was teaching myself assembler on two architectures, and by 16 I was advised not to take my senior year computer studies course because I knew, quote "enough to teach the course" and receiving "the top grade was a given".

So there is clearly no definite line - good programmers will learn from others effectively and bad programmers will forever cheat and never learn much of anything.

Perhaps accreditation on the part of the asker is the key, as well as providing pointers and pseudo code... but as a professional I also appreciate receiving code which just works, so I can understand the essence of it and get on with my task. My ability professionally has grown in equal parts from my own experience and other's code.


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