Skip to main content
Bring answer into 2018.
Source Link
user131
user131

I am not a lawyer.

However, you are absolutely free to use the following 3 lines of code in anything that you write:

for (i = 0; i < 5; i++) {
    printf("I am not a lawyer!\n");
}

In all seriousness.... That's purely functional code (not functional in the sense you might think, your questionbut functional by what it does). It doesn't actually accomplish anything; it simply exercises the constructs of the language. It supports stuff that does actual work, you type it often enough that you have a macro to produce it. But what you're talking about isn't 'fair use', it's is this even copyrightable or licensable in the first place?

The only correct answer here is quite broad and highly subjectiveask a lawyer. Ten lines of code from whatwhat? A highly specialized sorting algorithm? Some kind of firmware? One of the millions of configuration file parsers that have been floating around since the dawn of usenet? Code generated by another program that generates database classes based on your DB schema?

The golden ruleBut, reallyprove to me that you wrote that for loop, followor switch statement, and didn't just copy mine. At the license from whichpoint where assertions stop sounding absurd, you're probably at the snippet came. If that is not availablepoint where you should talk to a lawyer, useor at least your best judgementengineering manager / PM / etc.

I participate in several free/open source projects, some of them require a copyright assignment for anything not 'trivial'. All of them that have this requirement define 'trivial' to be ten lines of code added or modified. ThatBut that's just an arbitrary litmus test to establish some kind of standard; one line of mind-bending byte comparison is no waymuch more likely to be subject to copyright than a substitute for competent legal advice from someone in your country, however10 line switch.

My snippet gallery consists of hundreds of functions, all of them have the original author's information in doxygen style comments, as well as license info (if any, most are just public domain).

Unless clearly trivial (as in my humorous example), I would not re-use code unless I know that I have permission to do so. I also, always, follow the rules of whatever license applies. And to help my future self (or future maintainers), I like leaving a link to where I found stuff in a comment, even if that's the name of a tar ball I turn in on a USB stick if I leave the company.

I am not a lawyer.

However, you are absolutely free to use the following 3 lines of code in anything that you write:

for (i = 0; i < 5; i++) {
    printf("I am not a lawyer!\n");
}

In all seriousness, your question is quite broad and highly subjective. Ten lines of code from what? A highly specialized sorting algorithm? Some kind of firmware? One of the millions of configuration file parsers that have been floating around since the dawn of usenet?

The golden rule, really, follow the license from which the snippet came. If that is not available, use your best judgement.

I participate in several free/open source projects, some of them require a copyright assignment for anything not 'trivial'. All of them that have this requirement define 'trivial' to be ten lines of code added or modified. That is no way a substitute for competent legal advice from someone in your country, however.

My snippet gallery consists of hundreds of functions, all of them have the original author's information in doxygen style comments, as well as license info (if any, most are just public domain).

Unless clearly trivial (as in my humorous example), I would not re-use code unless I know that I have permission to do so. I also, always, follow the rules of whatever license applies.

I am not a lawyer.

However, you are absolutely free to use the following 3 lines of code in anything that you write:

for (i = 0; i < 5; i++) {
    printf("I am not a lawyer!\n");
}

.... That's purely functional code (not functional in the sense you might think, but functional by what it does). It doesn't actually accomplish anything; it simply exercises the constructs of the language. It supports stuff that does actual work, you type it often enough that you have a macro to produce it. But what you're talking about isn't 'fair use', it's is this even copyrightable or licensable in the first place?

The only correct answer here is ask a lawyer. Ten lines of code from what? A highly specialized sorting algorithm? Some kind of firmware? One of the millions of configuration file parsers that have been floating around since the dawn of usenet? Code generated by another program that generates database classes based on your DB schema?

But, prove to me that you wrote that for loop, or switch statement, and didn't just copy mine. At the point where assertions stop sounding absurd, you're probably at the point where you should talk to a lawyer, or at least your engineering manager / PM / etc.

I participate in several free/open source projects, some of them require a copyright assignment for anything not 'trivial'. All of them that have this requirement define 'trivial' to be ten lines of code added or modified. But that's just an arbitrary litmus test to establish some kind of standard; one line of mind-bending byte comparison is much more likely to be subject to copyright than a 10 line switch.

My snippet gallery consists of hundreds of functions, all of them have the original author's information in doxygen style comments, as well as license info (if any, most are just public domain).

Unless clearly trivial (as in my humorous example), I would not re-use code unless I know that I have permission to do so. I also, always, follow the rules of whatever license applies. And to help my future self (or future maintainers), I like leaving a link to where I found stuff in a comment, even if that's the name of a tar ball I turn in on a USB stick if I leave the company.

Source Link
user131
user131

I am not a lawyer.

However, you are absolutely free to use the following 3 lines of code in anything that you write:

for (i = 0; i < 5; i++) {
    printf("I am not a lawyer!\n");
}

In all seriousness, your question is quite broad and highly subjective. Ten lines of code from what? A highly specialized sorting algorithm? Some kind of firmware? One of the millions of configuration file parsers that have been floating around since the dawn of usenet?

The golden rule, really, follow the license from which the snippet came. If that is not available, use your best judgement.

I participate in several free/open source projects, some of them require a copyright assignment for anything not 'trivial'. All of them that have this requirement define 'trivial' to be ten lines of code added or modified. That is no way a substitute for competent legal advice from someone in your country, however.

My snippet gallery consists of hundreds of functions, all of them have the original author's information in doxygen style comments, as well as license info (if any, most are just public domain).

Unless clearly trivial (as in my humorous example), I would not re-use code unless I know that I have permission to do so. I also, always, follow the rules of whatever license applies.