Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

In academia, it's considered cheating if a student copies code/work from someone/somewhere else without giving credit, and tries to pass it off as his/her own.

Should companies make it a requirement for developers to properly credit all non-trivial code and work that they did not produce themselves? Is it useful to do so, or is it simply overkill?

I understand there are various free licenses out there, but if I find stuff I like and actually use, I really feel compelled to give credit via comment in code even if it's not required by the license (or lack thereof one).

share|improve this question
add comment

3 Answers

up vote 12 down vote accepted

I'd say this is probably essential. For one thing, the company may need to deal with any license terms and other legal implications - just because it's "free" doesn't mean you can do what you like with it.

However, there may be an exception with example code copied and adapted from reference books. After all, that's basically what that code is there for. Even so, a comment is a good idea - someone may need to go back to the source for bugfixes (e.g. in errata), or for a better understanding of why you used it.

share|improve this answer
    
+1: I worked for a company where some of the programmers took a whole bunch of copylefted code and copy-and-pasted it into the sources for our proprietary components, complete with the original comments. We were lucky to discover this before shipment, and it was a real mess to rewrite that. –  Bob Murphy Feb 13 '11 at 21:05
    
good answer on both counts - protecting yourself from litigation is important, as is the ability to 'source' solutions –  HorusKol Feb 13 '11 at 22:39
add comment

I always do. I also link back to the original source. I do this more for reference then to give credit. (So I can go back and see the original authors notes and or updates)

I think its good practice, but totally unenforceable, having a policy in place is almost worthless, as I don't think it will change anyones behavior.

share|improve this answer
add comment

Credit is important to me, and I try to credit others as much as possible (even on Twitter), but other than regular commenting for additional information about the code, and potential licensing issues, I think it's overkill.

First of all it has the potential to become overly complex crediting in every situation.

And second of all, if a person is integrating good, clean, secure code and delivering results, as long as there aren't any licensing issue, the source is irrelevant. (at least from a business standpoint)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.