As a web developer over the years, I've done work in HTML, CSS, jQuery, PHP, and MySQL. And there have been numerous times I have found code snippets on Stack Overflow to be useful. I've probably copy/pasted small bits of code into a number of websites and projects. I personally feel like all of the code I've copy/pasted would probably be considered a "fair use" type of thing.
However, it looks like basically all Stack Overflow code snippets in the questions and answers are CC BY-SA with attribution required. I didn't find this out until recently! So now I am concerned about failing to comply with the CC agreement.
I already took a look at the attribution required link (at the bottom of all the pages). While helpful, it seemed geared toward "republishing content" whereas all I care about is simply copy/pasting some code here and there.
But if I were to attribute, how should I do it?
Some forms of attribution I thought of:
- a public "credits/attribution" page on the website
- lots of little attribution comments in the source code
- one big "credits.txt" buried somewhere on the web server file system
Any answers or personal opinions on the matter are appreciated!
UPDATE (May 9th, 2014)
Well guys, as of the time of this edit, I must say this question is pretty subjective, but I've enjoyed the dialogue with all of you. Really the word "should" in the question can mean different things. I think @hakre's answer, in conjunction with @JeremyBanks gives the most "legal" answer. Whereas @Bill the Lizard and the other answers give the more practical, or reasonable approaches (though not necessarily "legal"). Personally, I am not settled completely on this matter, but for the most part will continue to copy and paste small bits of code without attributing them, and in rare circumstances perhaps I will message the "author"/copyright owner of the post to find out if I may freely use their code (without it being affected by viral CC).
It seems appropriate to me to bring up the quote "do unto others as you would have them do to you". And "love your neighbor as yourself".