Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm in the process of coding a game and almost done with the game mechanics to the point where it's pretty playable. I later discovered an open source version of the kind of game I'm making with the same mechanics, whereas I coded mine from scratch.

However, in the interest of optimizing later on, I may want to adapt a small part of the open source project's code. The project is under the GNU GPL 2, and it's coded in a different language for a different framework (Android/Java versus mine on C#/XNA). What are my options as to copying functions / routines from a GPL open source project, if I would have to port the code anyways, for the language I'm using?

These are not patented algorithms I'm talking about, just code I found that could possibly make my program more efficient or stamp out a bug.

share|improve this question

In practical terms, if you read the java source code and then re-create it yourself, no-one will ever know. If you take the java source code and simply modify it so it compiles in C# then the owner of the original would have cause against you if its so obvious that this is what you've done (and therefore your game would become licensed under the GPL too)

Ethically, you should recognise you're taking someone's work - work that they want you to have, but with obligations. You could contact them and ask to use the pieces of code for a closed-source game, a lot of OSS people will happily allow that, or you could contact them and offer to licence their work for a small fee.

share|improve this answer

Your Answer


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.