Do You Have To Attribute Stack Overflow Code?
Written by Mike James   
Monday, 18 January 2016

At the moment the answer to the question is "probably", but this might change very soon. 


The question of "who's code is it anyway" is something that applies to any forum or question and answer site. In fact the question can be more widely put as "who's copyright is it" on any natural language forum or question and answer site. However when it comes to code the issue is much sharper and important.

The whole point of a code question and answer site is to provide solutions to code questions and the chances are that those solutions are going to be used by something like copy-and-paste. If the code presented is licenced in any restrictive way then it makes a nonsense of providing a solution in the first place - you can look, but you can't use. 

StackOverflow is one of the most used of the programming problem solving sites and it has saved every programmer substantial amounts of time. There are even urban legends (perhaps not so far from the truth) about programmers who basically just work by copying and pasting chunks of code from StackOverflow.

Most of us have never thought for a moment about the status of code reuse on StackOverflow simply because it seemed like a non-issue. The question is asked the solution is provided and the code must therefore be offered for use - but Stack Exchange, the group behind all of the "Exchange" forums is in the process of attempting to clarify the situation and is creating a storm of user protests at the same time.

Initially the intent was to try to improve the licensing situation by:

"transitioning to a more user-friendly code license".

However, in doing so it was made very clear that the code on the site was not "public domain" and that " attribution is already required".

The code is currently covered by a cc by-sa 3.0 licence with attribution required and it is planned to move to an MIT licence, which also requires attribution.  The attribution, it is suggested, should be in the form of comments within the source code where it is used. 

The whole idea is complex and difficult, but it is easy to see that the code might not belong to the user posting the final solution. A user posts a question with some sketch code, then another user posts an attempted solution then another a final solution - it is a team effort.

In this case is attribution fair? 

Will enforcing, strengthening or even drawing attention to the code licensing do StackOverflow any good?

Clearly not, because it means programmers have to think before they ask a question, think before they answer a question and think before they make use of any code fragment. Unless the rules are so simple that these thoughts are all unnecessary, StackOverflow becomes far less useful. 

You can see that StackOverflow probably has to protect itself and its users in some way or other. Imagine if a big publishing company created a book by copy-and-pasting answers. However, in the book context the explanations are as valuable as the code and it would be easy to assign the copyright of the text to the author and put the code in the public domain - so allowing free code use without allowing other sites and publishers to simply reuse material. 

So what is the outcome?

StackExchange is responding to users worries and negative votes:

Update: January 15, 2016

Thank you for your candidness, patience and feedback. We're going to delay the implementation for now - we'll be back soon to open some more discussions.

If you want to make your point of view known, now is the time. 


More Information

A New Code License: The MIT, this time with Attribution Required

Related Articles

StackExchange AI Contest 

Google Changes Course For Android N 



To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on, Twitter, FacebookGoogle+ or Linkedin



GR00T Could Be The Robot You Have Always Wanted

We may not have flying cars, but we could well soon have robots that match up to predictions for the 21st century. Nvidia has announced GR00T, a cleverly named project to build robots using foundation [ ... ]

Deno Improves JSR Support

Deno has been updated to improve JSR support, and to build on the Temporal API introduced in version 1.4.  Deno is the JavaScript and TypeScript runtime from the creator of Node.js.

More News


raspberry pi books



or email your comment to:

Last Updated ( Monday, 18 January 2016 )