I don't currently have a job, but, out of curiosity, do you think that using Stack Overflow is cheating?

Is it somehow plagiarizing someone else's code?

By asking a question, are you somehow taking advantage of people?

Do you ever use Stack Overflow for work related questions? I mostly use Stack Overflow for hobbies so I don't know.

  • 19
    Do you ever use stack overflow for work related questions? I use it only for work related questions...
    – yannis
    Aug 11 '12 at 3:06
  • 11
    If using code others have written and published under an open license is cheating, all programmers are doomed
    – Ben Brocka
    Aug 11 '12 at 3:08
  • 11
    The real world is not like school. Your boss wants your work done now and doesn't care if you have to ask for help when you're stuck.
    – meagar
    Aug 11 '12 at 3:13
  • 1
    Cheating? I wouldn't think so - everyone at my workplace uses it!
    – Makoto
    Aug 11 '12 at 3:59
  • 2
    You might get in trouble with your boss if you post large parts of the company's proprietary code in the questions. :-)
    – Bo Persson
    Aug 11 '12 at 10:06
  • Work is not a contest or competitive sport.
    – danielm
    Oct 1 '15 at 18:23

Code on Stack Overflow is all completely under a Creative Commons BY SA license. You can freely use any code or text on the site anywhere else as long as you give attribution properly.

And honestly I don't think anyone is going to sue you for using a couple lines of code you saw on SO even if you don't include a comment attributing it to Stack Exchange. You can't really copyright printf('hello world!') You copyright a codebase, not a few lines.

  • 4
    I've always wondered how I could, let alone would give proper attribution in my code at work for an answer pointing me to a particular api option I had been misusing. Aug 11 '12 at 3:52
  • 1
    Why would you want to copyright something that won't even compile? Aug 11 '12 at 6:47
  • Nice answer Ben
    – Divi
    Aug 11 '12 at 7:17
  • You don't need just give attribution. You need to license derivative works as CC-BY-SA, which is problematic for code. Feb 27 '13 at 10:43
  • @CodesInChaos that seems to disagree with both the footer user contributions licensed under cc-wiki with attribution required and the actual license, which has "attribution" right in the name in addition to explicitly requiring it: creativecommons.org/licenses/by-sa/3.0
    – Ben Brocka
    Feb 27 '13 at 13:37
  • @BenBrocka I did not dispute that you need attribution. But I dispute that attribution is enough. As the page you liked says "If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one." ("similar" means approved as compatible, and there currently are none of those) Feb 27 '13 at 14:25

Stack Overflow exists for people to get help solving coding problems. Whether the problem comes up in the course of hobby programming or professional work doesn't matter at all: if you need to know how to do something, this is a good place to learn.

To paraphrase the immortal T.S. Eliot: "Immature coders imitate, mature coders steal." People who are great at problem solving don't waste time dinking around: they use the resources that are available to them.


Short answer: no, it's not cheating.

A cheater is someone who breaks rules to get an unfair advantage or benefit.

In school, there are rules governing what students can submit on their assignments because it's unfair for someone who studied the material and worked hard to get the same grade as someone who merely copied an answer key. That's reasonable, given that the goal of school is to ensure that students are actually learning things and accumulating knowledge.

In the corporate world, the aim is generally to produce a high quality product as quickly and cheaply as possible, in support of the ultimate goal of maximizing profit. Employees are — or should be — encouraged to make use of all possible resources, like books, co-workers, mailing lists and online communities. There is no answer key to be copied or unfair advantage to be gained. (Ernest points out in the comments that this is not quite true, because of criminal activity, but I consider that to be outside the scope of this question.)

So, the long answer: using Stack Overflow at work is not and cannot be cheating, since the very concept of cheating has no meaning in this context.

  • Well, that's perhaps a little bit too strong for me. If a disgruntled ex-employee brings you a competitor's code, it's unethical (or illegal, depending where you are) to use it. Using certain resources really is cheating. But a published information source like SE? Not cheating at all. Aug 11 '12 at 10:51
  • @ErnestFriedman-Hill heh, okay, yes, corporate espionage is cheating. For that matter, kidnapping famous programmers and making them do your work for you is a no-no. I thought that that kind of thing went without saying, and that it was outside the scope of this question.
    – Pops
    Aug 12 '12 at 21:36
  • You'd be surprised, especially international attitude toward corporate espionage. Aug 12 '12 at 23:48

I use Stack Overflow and Stack Exchange GIS all the time at work. It is a knowledge base just like Google and when you're stuck in a problem you will seek help whether it's from your colleagues or from Google or some knowledge base. Of course, you won't be copying code and claiming it to be yours, but it is perfectly good to be using Stack Overflow.

Now in regards to copyrighting images/products and especially software: I have had extensive experience trying to copyright software packages - it's next to improbable. Especially with the managed code - you can 'disintegrate' it :) Change all the variables name and oops - your code is my code. It must be a really an original idea and a 'packaged' implementation and then you will have to spend more effort obfuscating the code, protecting your IP address and in six months - shebang, it's not relevant anymore. So let's all agree that writing the code from scratch is reinventing the wheel, someone already solved the problem, why spend time and money on that? Copying the code 'as is' without understanding and really integrating it with your code is useless and won't work. Other than that it's like UFC - "the rule is that THERE ARE NO RULES!"

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