I was wondering about something:

LazyFoo, the author of some amazing SDL tutorials has put copyright on his source code. Does this prevent people from writing functions that are largely, if not entirely similar to his? For example, his 'load_image' function used in a lot of the tutorials is extremely useful. Does the copyright prevent me from using this function, or one very similar to it in my own code and then posting it online, on say - this forum?

It largely depends on, What type of copyright it carries ?
Can you share the copyright message.

this is from lazyFoo's faq page
Q: Can I use your code to make a game?
A: Basically my rules are:
1) If you're using it for a closed source program, go nuts.
2) If you're using it for an open source program, please cite the chunks of code you used with something like:

/*This piece of code was originally from Lazy Foo' Productions
(http://lazyfoo.net/)*/

3) I you're using it for a GPL, LGPL or other such program which gives public rights to the code, I'm going to have to say no.
4) If you're using it for a tutorial, you're going to have to use your own original code.

You still need Contact me and show me specifically the code you plan to use and what you're going to do with it so I can approve.

Wow, LazyFoo seems to be quite an idiot when it comes to licensing issues. So, he basically says:

1) Closed-source, commercial or not: OK to use his code.
2) Open-source, commercial: OK to use his code (with credits given).
3) Open-source, free: Not ok to use his code.
4) Tutorial or demo: Not ok to use his code.

Most licenses are structured entirely the other way around, i.e., any commercial use requires agreement and some licensing deal, and any non-commercial use requires only proper credits given to the original author (and possibly a copy-left clause). His "licensing" policy makes no sense.

Also, remember that he, as the author of code, only has license rights on what is original in his code. Simple functions that just use a few SDL calls to setup something are not his intellectual property because that's just a normal use of the SDL API. So, like most basic programming tutorials that show basic well-known code snippets, those codes are not the intellectual property of the tutorial writer, they are public-domain. Intellectual property applies only to things that have been originally developed (e.g. an original idea, and special new technique developed).

Otherwise, I could write this:

--- Tutorial --- (NOTE: Fictional)
This tutorial will show you how to print "Hello World!" in C++. Here is how:

#include <iostream>

int main() { std::cout << "Hello World!" << std::endl; };

Copyright: 2011 Mikael Persson. Reproduction of the above code in any context can be granted at a cost of 1 million dollars to Mikael Persson.
--- End tutorial ---

The above would make me a billionaire if Intellectual Property applied here, but it doesn't because the above "Hello World!" program is public-domain, the above is not my original development of anything special. And if you could trace back to find the true original author of the first "Hello World!" program, he still wouldn't have intellectual property over it. That's what "public-domain" means.

From quickly browsing through LazyFoo's tutorial codes, I don't see anything there that is really original or special, besides the "tutorial" part itself (i.e. the explanations as such, not the code itself). Courtesy mandates that you give credits to him for whatever code you integrally copy-pasted from his code.

But legally, I don't see that you have any kind of problems. What I mean is, hypothetically, if you take his code, change a few variable names and the code structure, add/remove stuff, there is no way for him to prove that you used his code, for the simple reason that his code does not contain truly unique and original things (it just demonstrates basic techniques). This is a good indication that intellectual property does not apply.

I'll give you an opposite example. Say I develop some kind of awesome sub-linear sorting algorithm (which is impossible, but for sake of example). Then, this algorithm would be very unique and original, and assume I would keep the knowledge of that algorithm very secret. If someone somehow took my code, then, even if he changed all variable names and refactored the whole code, I could still manage to prove that his implementation is a copy of my work, because you cannot hide an original idea or a unique method. Then, it would be his burden to prove that his development was an original work too (like two people developing the same thing without knowing about each other's work).

In the case of LazyFoo's code, you could hardly distinguish his code from the code found on plenty of other SDL open-source software or tutorial sites, just like you couldn't find any real original idea or unique method in my "Hello World!" program when compared to stuff you can find all over the internet. But, again, for courtesy's sake, you should give him credit, but he has no legal recourse of any kind (unless some parts are truly original).

Finally, generally if the explanation of a method or algorithm is publicly available, then the method becomes public-domain. What I mean is, if you read the tutorial that describes a particular method, then, afterwards, you _know_ that method and if you write code that implements that method, it's not the intellectual property of the person who came up with the idea, because he disclosed, publicly, the idea or method. In other words, unless you sign a non-disclosure agreement, any knowledge you acquire is yours (in the opposite case, if you start at a company and sign a non-disclosure agreement (NDA), it means that all knowledge you acquired within that company is not yours and you cannot use it or disclose it outside the company). Since you don't have to sign any legal papers to access and read LazyFoo's tutorials, that knowledge is public-domain and so is his code.

So, this means that LazyFoo pretty much nullified all his legal intellectual property rights to any of his tutorial codes by writing the tutorials themselves (which is common, all tutorial codes are public-domain, as far as I'm concerned). Which brings me back to my original point: LazyFoo is quite an idiot when it comes to licensing issues (and a bit of a license bully too). As far as I know, the only thing you are not allowed to do is republish his tutorials as if they were your own. You can reproduce/reuse his code or methods as much as you like, giving credits is only a matter of courtesy, not of legal obligation.

interesting, but "idiot" is pretty harsh don't you think?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.