Sign in to follow this  
alamed

Whats the rules on code reuse? (from books and such)

Recommended Posts

Hello, I was wondering about re-using the codes in books and tutorials. If I'm not copy-pasting the code, can I call it mine? For instance, I'm following the "Killer Game programming for Java" book. The author gave the permission to use the code if I mention the book and his name, but I'm only following the framework/the classes skeleton (as in how things are done). can I still call it my code? I don’t want to be called a copier or steal his work. In short: when the code becomes yours and not a copy? Thank you

Share this post


Link to post
Share on other sites
If he wrote it, he owns it, end of story (at least in the US). If you really don't want to mention his name, you should apply the concepts from the book and write your own framework (which would give you more programming experience anyway).

Share this post


Link to post
Share on other sites
I would have to say once you've thought about the program logic yourself. This might just be me, but if I programmed the same program as someone else, with maybe a few slight differences, I would want to call it my code since I did think about it all myself, someone just happend to make the same thing. Unfortunately, that would only mean(to you) that it's your code, depending on who released the program first.

Share this post


Link to post
Share on other sites
Once you make significate modifications to the code it is yours. What is significate modifications, well if you just add a little formatting and a minor error check then that does not do it.

I would suggest instead of following thier code line for line you learn what they are doing and then write your own code. This avoids the problem and in the end you learn a lot more.

theTroll

Share this post


Link to post
Share on other sites
As a general rule of thumb, ideas can not be patented. So if his code demonstrates a very common way of solving a problem, or a very common algorithm, then there will be limited ways to rewrite it without following its structure closely. But don't fret - in those instances, you're protected under some law of "public knowledge". Failing that, apply his concepts to your own code.

Share this post


Link to post
Share on other sites
You could generalize that to "if an author doesn't want his writing copied, he shouldn't publish it" and "if a game developer doesn't want his title pirated, he shouldn't publish it." Just because information is publically available doesn't mean that it is yours to take and call your own. The author owns the copyright/IP/whatever for his work. You do not; its your responsibility to *not* steal it.

Share this post


Link to post
Share on other sites
If the author has given you permission to use the code if you mention his name... why do you feel constrained? How does it hurt you to mention his name?

Two words: Intellectual honesty.

Share this post


Link to post
Share on other sites
Quote:
Original post by alamed
The author gave the permission to use the code if I mention the book and his name, but I'm only following the framework/the classes skeleton (as in how things are done). can I still call it my code? I don’t want to be called a copier or steal his work.

Usually an author's code would also include any derivative works. So even if you only use a small portion of his framework to base your code off of, you're still using his code and should mention his name and book.

Share this post


Link to post
Share on other sites
Quote:
Original post by jpetrie
The author owns the copyright/IP/whatever for his work. You do not; its your responsibility to *not* steal it.


I am on about using, not stealing.

Share this post


Link to post
Share on other sites
If the book comes with a source CD, it may have a EULA. I'd check there first. Then I'd check her - or the publisher's - website.

edit: didn't see that you already contacted the author. An actual framework, no.

Share this post


Link to post
Share on other sites
Wow, wasnt expecting this many replies. Thank you all! :)

.... I didnt contact the author, he said in the book that I can use the code if I mentioned the book and his name. But when can I call the code mine if I'm copying it?

here is an example: the ways he handles the window events and the game initialization are good, and I want to keep using them in my games from now on. but that will mean I always use his way of doing it. .... when can I call the code mine? I will always remeber the author as my "mentor", but I dont want the code to be called "stolen" if I didnt mention his name.

I know I'm thinking about it too much, but I hate to steal other people efforts/rights. I want to be proud of my own creation.

again thank you all for the relpies :)

Share this post


Link to post
Share on other sites
If you copy and paste the code, it will never be yours, no matter how much you alter it. If you write it yourself based on what you read in his book, then it's yours, provided you weren't trying to copy his work literally. But when it comes down to basics like events and initialisation, it's quite likely that the methods he uses are obvious and common to many programmers, so for you to use them doesn't technically require credit.

Share this post


Link to post
Share on other sites
Yeah as you continue on your journey you will notice about 95% of c++ windows games have the standard:

Game_Init();

while(!done)
{
TranslateMessage(somemessage);

Game_Run();
}

Game_Shutdown();

If that's all your using I wouldn't worry about giving credit for that, it's so common I hardly think anyone "owns" it. What won't be so common is a library that the author has created, and perhaps, depending on detail, a framework.

I like to give credit to the author because newbies who will look at the code can see what book you got it from if they like it. If you are using someone's framework but have modified it as your own you can always just say "Thanks to <name> for some good framework code" or "Framework inspired by <name>." As a lot of authors are active in the community, I think they will for the most part agree that, if you are just using their framework and not copying their library or actual game code, they aren't going to be upset if you don't mention their name.

Good luck!

Share this post


Link to post
Share on other sites
good point!
and the author has gave the permission for reusing the code already, so why not thank him at least. I'll do that. Thanks ChurchSkiz, .... and I use Java :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this