19

I was wondering what kind of restrictions there are, if any, for code posted on StackOverflow?

In other words, I'm hoping StackOverflow has a clause that makes any posted code completely free of restrictions for reuse? (Both questions and answers).

jzd
14.4k4 gold badges36 silver badges56 bronze badges
asked May 9, 2011 at 15:47
0

2 Answers 2

10

Right down at the bottom of every page is "user contributions licensed under cc-wiki with attribution required".

"User contributions" links to questions-all, but I don't think "user contributions" is solely limited to questions. All code posted here is thus licensed under cc-wiki with attribution required.

Edit: If you click on any of the related links down the right side that seem relevant, you'll find that the copyright owner becomes Stack Overflow (or, I guess to be correct, Stack Exchange Inc.), and that's who you'd have to attribute. See also this question.

Edit 2: There's also this answer from Jeff Atwood, which may or may not clear things up for you.

answered May 9, 2011 at 15:53
1
  • 1
    What level of attribution? Is a hyperlink enough? Commented Jul 6, 2011 at 2:38
9

No matter what the legal implications are, you should never use code samples found online.

You should always read the code, understand what it is doing, then close the browser tab and use that understanding to code.

answered May 9, 2011 at 16:21
6
  • @MattHandy: Please, I don't give a... Commented May 9, 2011 at 17:25
  • Sorry about my English. What is the meaning of understand ? Commented May 10, 2011 at 3:05
  • @Wether: to know how and why it works, and to be able to reproduce the same effects without referencing the original code. Commented May 10, 2011 at 13:10
  • @Will Ohhh... And you want that from a programmer :) Commented May 10, 2011 at 13:14
  • @Wether: Sarcasm. I get... I mean, I understand now. Commented May 10, 2011 at 13:36
  • But what if you happen to end up retaining bits of the code itself in your memory? It seems to me the only "safe" way is "just never use any answers that involve substantial amounts of non-trivial code for the given solution". Commented Apr 20, 2022 at 14:36

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.