David Thornley has some good insight on this issue which hasn't received much positive attention:
CC-BY-SA is not an all-permissive license like the modern BSD type. It's much closer to the GPL, in that derivations have to be under a share-alike license.
For some programmers, this is fine. I work on internal software, so it really doesn't matter what Free/Open Source licenses we use. All we need is permission to use, modify, and distribute internally, and that's what we do.
On the other hand, some of us make money by selling software in the traditional sense, and CC-BY-SA isn't compatible with that business model. (I've had a couple of jobs like that.) Some of us work for companies with lawyers or managers who don't "get" free/open source software. (I've had some clueless managers.) In this case, anything short of a BSD-type license might frighten them.
Nor does the "excerpt" idea necessarily help. There is, as far as I know, no official lower bound of what is copyrightable, and there is not necessarily a right to use excerpts. In the US, "fair use" is in the copyright law, but again there's no actual definition: it's a judgment call that should consider several things. There's legal dangers with rewriting snippets also, in that it isn't clear what's a derivative work. All of these would potentially have to be decided in a court of law, and that's expensive.
So, there is a very real problem for individuals or companies that sell proprietary software and don't want to be in the position of having to defend what they include in court.
I think it would help if we had a handy BSD-type license we could slap onto code snippets as we wished.
From What is up with the source code license on Stack Overflow?What is up with the source code license on Stack Overflow?.
Another example where the existing license is shown to be wholly inadequate:
If you are talking about taking code from Stack Overflow for use in your work, I would be very careful. Even if it is the opinion of the people here that posts to Stack Overflow are covered by Creative Commons, you will need to be able to prove that you got the code from here.
A Short Story To Illustrate:
- Someone else decides the code is a good solution for a problem they are facing, and decides to copy it into their open source GnuFizzBuzz project, covered by the GPL.
- Five years from now, someone is doing an open source audit on your code (maybe you are selling to a nervous customer, or your company is going public).
- The open source audit finds the snippet of code you got from Stack Overflow, and recognizes it as originating in GnuFizzBuzz.
- You are now stuck explaining how/why you have GPL code mixed into your commercial product, or proving that the code was actually from Stack Overflow. Can you prove that the person posting the code to Stack Overflow owned it to begin with (maybe they actually copied it from GnuFizzBuzz to begin wih).
It may sound unlikely, but I have seen this exact situation with my own eyes. The safe thing to do is to regard any code snippets you find as explanations of how something could work. Read, understand, and write a solution based on your understanding. Don't ever cut/paste code you found on the Internet if you are working on a commercial product.