I ported a library to Java, but am wondering what to do with the JavaDoc comments. The original library used javadoc comments too, so do I leave the @author tags from the original code? And how do I give myself credit as the person who ported it over?
-
2How are you porting a library *to* Java, if the original lib contained JavaDoc comments? Ultimately, though, what you **must** leave in is determined by the license, which you have not mentioned. – Jason Lewis Jan 14 '12 at 02:45
-
Other languages use JavaDocs too btw. ActionScript for example. I think you can assume I have checked that I have permission to port the library. I am really looking for best-practice. – Adam Harte Jan 14 '12 at 03:54
3 Answers
The license that governs the original code will likely define what is required - many licenses require you to explicitly give credit if you create a derived work.
In terms of what is appropriate, I'd suggest that it's always appropriate to give credit to your sources, for example:
@author Java port by Adam Harte, based on ActionScript original by Bill Gates
(And yes, I know this isn't accurate, as the OP didn't tell us the original language or author, it's just an example.)

- 3,170
- 20
- 22
Legally, in most places where software is written (including NZ), your port is a copyrightable derivative work (through either translation or adaptation, it's not obvious which) based on another copyrighted work. Assuming the license on the original work allows you to do the port at all, you must respect the rights of the original authors, including attributing their work to them.
Ethically, unless your port involves significant creative effort, it isn't even clear that you deserve any credit at all. Many is the time I have "transliterated" an algorithm from one programming language to another, where my effort consisted merely of mapping one set of keywords and special symbols to another. Java and C#, for example, are so closely related that I'd have a hard time claiming a copyright in any code I moved from one to the other.

- 10,277
- 34
- 43
I'm no expert, but basically I believe you are the author of the code you have written, as long as it's not a copy, and you were allowed to look at the code in the first place. The original code is just your inspiration. Best practice is to clearly mention who wrote the original code though.
To elaborate I believe copyright does not protect code if it is re-written in a different language, even if it is pretty close to the original. If the solution represented by the software is patented however you can't reproduce it in any language.
The only question as far as I can see is if a port is to be considered derived work, and if the particular licence protects this.
Edit:
It seems like most people disagree with me, and consider re-writes in a different language to be derived work: https://stackoverflow.com/questions/1919010/does-porting-count-as-derivative-work
The accepted answer here however says otherwise - that only the actual lines of code in the original software are protected: https://stackoverflow.com/questions/77044/licensing-a-rewrite-from-gpl-to-mit
-
2Boo! This kind of playing fast and loose attitude with IP that gives software coders a bad name. It is definitely not "just your inspiration" if you look at the code and reproduce the same interface and functionality in a different language. – ThePopMachine Jan 14 '12 at 06:58
-
I would be very interested in hearing your answer on this topic @ThePopMachine – Adam Harte Jan 14 '12 at 07:01
-
@ThePopMachine, if you believe this isn't the legally correct answer, please vote me down. I'll try to find a credible source for my view. Basically this is what I believe to be true. Take the various XUnit frameworks for examples. Who are the authors? They are basically just ports of eachother.. – Torbjørn Jan 14 '12 at 07:16
-
@Torbjørn Without this being a comment in your answer (I don't have an opinion on the matter), please refrain from answering questions if you have to `try to find a credible source for my view`. This is not the best place to share your opinions, unless of course you can back them up by facts & references. – yannis Jan 14 '12 at 16:42
-
@Torbjørn: My problem is with the attitude in the first two sentences. You seem to think it's okay to look at the code, and as long as you type it in in a new language, the original is "just inspiration". Where are you drawing the line? What if I translate from Python to Ruby line by line? What if you use machine translation? What if it's from ANSI C to C99 ? Copyright protects the way things are expressed, but this isn't limited to just the exact sequence of characters (which is changed by porting from one language to another). – ThePopMachine Jan 14 '12 at 20:51
-
@Torbjørn: ... and if I translate a Russian book into English sentence by sentence, that doesn't avoid copyright issues just because none of the words are the same ! – ThePopMachine Jan 14 '12 at 20:52
-
@Torbjørn: The Berne Convention applies to software, and clearly discusses the rights of the original authors in any translation or adaptation of their work. The OP's port is clearly a derivative work, and while it is itself copyrightable, the original authors have the legal right to be represented in its attribution, and even to prevent the port if they choose to do so. – Ross Patterson Jan 15 '12 at 16:23
-
I think I'm in the right to state my views on this, which I did, and I also clearly expressed that it was MY BELIEF, and that I'm no expert. I think the discussion it triggered is valuable, and your possibility to downvote my answer ensures that my view is not considered the truth by anyone. I have tried to investigate, and can find no good information on this exact subject - whether porting is considered derived work, and whether copyrights apply. The licenses I've seen does not mention anything about this either. In practice much open source code is ported without giving author rights back. – Torbjørn Jan 16 '12 at 08:40
-
@ThePopMachine Where I would draw the line: Machine translation would mean you didn't write the code, you just compiled it. And I believe translating source between different programming languages is fundamentally different from translating a text from one human language to another. Mind you, I'm not talking about ethics here, but my interpretations of the law - of which I clearly don't know much :/ – Torbjørn Jan 16 '12 at 08:48
-
@Torbjørn: I understand, but my point was, What if I choose two languages that are almost the same or even identical (i.e. two flavors of C) ? What if you spent years on a project and someone tried to avoid copyright issues by simply rewriting it in another language? – ThePopMachine Jan 16 '12 at 18:25
-
@ThePopMachine To protect your software from re-writes you should not grant users the rights to read your code. Once it's read, the knowledge is in the users brain, and you can't regulate what people are allowed to know. Theoretically I could read some code, tell another person all about what I read, and he could be able to reproduce it line by line (far fetched for larger projects, I know). This is how many clones have been legally created in our industry for years (see Triumph of The Nerds documentary). – Torbjørn Jan 17 '12 at 09:11
-
@Torbjørn: You attitude is just wrong. IP protection protects ideas. The whole point of copyright is NOT to require that you prevent (or deny the right for) people reading your works. Copyright other IP protections are the opposite of security through secrecy. – ThePopMachine Jun 29 '15 at 17:18
-
@ThePopMachine Since you restarted the discussion after three years; Ideas CAN NOT be protected unless kept secret, the execution of ideas can however. The question here is how far this protection goes. When is it copying, and when is it not? This will always have gray areas, because once you have seen something it's impossible not to be effected by it, and let it influence your future behaviour (coding in this case). Porting is more deliberate though, so I might be wrong believing I would not have to attribute. Btw. how can an attitude be wrong? An attitude just is :) – Torbjørn Jun 29 '15 at 21:48
-
1@Torbjørn: I only stumbled back on this because for some reason I was looking at previous comments of mine. How can an attitude be wrong? Because we're talking about legal matters, not opinions. If you do the wrong thing legally, you are asking for jailtime, $1k-1Ms of fines for your employer or yourself, and not only unemployment but the end of your career. The only reason I found myself drawn to comment again after three years is because it is honestly a very serious matter which you need to wrap your head around. Or get used to the idea of working at SBUX. Consider yourself warned! – ThePopMachine Jun 29 '15 at 22:05
-
@ThePopMachine The more I think about this the more interesting it becomes. Philosophically that is. It is generally considered acceptable to use the "clean room" method of copying a design by reverse engineering and then recreating it without infringing any of the copyrights and trade secrets associated with the original design. Isn't this basically a "two step porting" process? About what the correct answer should be to this SO questions though, then yes, a port is derived work. – Torbjørn Jun 30 '15 at 11:27