Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

Possible Duplicate:
Attribution etiquette in code — do you cite helpful question URLS in code?

If someone answers a question with some code, what's the etiquette for including it (and its technique) in closed source software?

Do you add a comment with a link to the SO question or do you just take the advice and implement the code without any attribution?

Boaz Yaniv really helped me out of a jam with this answer:
Python: override __str__ in an exception instance

...and I want to make sure that my team doesn't think I'm the smart one based on Boaz's inspiration.

Any advice?

share|improve this question

migrated from May 9 '11 at 17:22

This question came from our site for professional and enthusiast programmers.

marked as duplicate by Uphill Luge, Jeff Atwood May 11 '11 at 6:16

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

This should be on meta. – hammar May 9 '11 at 17:22
Man, this is like the first law of coding: only include attribution when the code breaks. :) – MusiGenesis May 9 '11 at 17:22
This is what comments in your source code are for. Every language worth writing in supports them. – Cody Gray May 10 '11 at 8:47
up vote 10 down vote accepted

It's partly etiquette, and partly good programming, but I'd definitely add the comment with a link to the SO question. Not only is it polite, but it will add context to the code on the off chance that your documentation doesn't answer all questions.

See also this question which addresses the legality: Using code posted on StackOverflow

share|improve this answer
I can't provide any examples but I know for a fact that I've seen someone include an SO comment in their code on a publicly available project – Daniel DiPaolo May 9 '11 at 17:27
@Daniel DiPaolo: Google Code Search has zillions of examples of that. – Greg Hewgill May 9 '11 at 22:43

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