I was wondering what constitutes as fair use for code. For example, implementing a flood fill from pseudocode from Wiki. Or if a user here gives pseudocode, does your implementation of their pseudocode constitute as fair use or is this copyright infringement. What about a modification of a C algorithm? Where are the boundaries? Thanks
No Bounds unless the author stated so.
(and Even if he stated so, You can't enforce it, specially if the staff is out in the open).
There is no ethics here, but if you use someone else code/idea, at least tell him / give credits.
If the staff is copyrighted... or if the author asked not to use it.. than ethically you shouldn't, and in real life... you can use it on you own risk.
I don't know about the US, but here in Europe algorithms are not considered intellectual property. Taking an algorithm and implementing it yourself is therefore always allowed.
Almost unanswerable without a specific example, and each situation may be different.
If the code has associated license terms, you should abide by them. If code of any kind is posted here, I don't think anyone could reasonable expect any protection, it is essentially in the public domain. If one did not accept that it would be used, why would one have posted it here!?
Code can be copyright, in some parts of the world it cannot be patented. On the other hand in other regions, software patents are granted.
[edit]I am not a lawyer, none of the above should be take as license for any action whatsoever.
It varies by jurisdiction. Here in Canada, the moment you write something, that particular bit is subject to an implicit copyright granted by our copyright law to you. However, it doesn't cover translation from one thing to another, unless that is your only source. In addition, with our new copyright law about to be passed, under the digital locks provision, you would not be allowed to translate psuedo code into actual code, as that could be argued to constitute a digital lock, which trumps the education fair dealings provision.
All this said, if you do not see any terms and conditions, one thing can be guaranteed the "safe bet" for all jurisdictions -- Don't use it. In my jurisdiction, if it comes with no terms, even if it's on this website, no express permission has been granted to use it.
Well I'd imagine that if you look at the history of applications, you'll find a lot of it is about stealing code.
I mean Windows stole a lot of things from the freeware market in their OS and make people pay for it. Yet they're so massive and large, that nobody can really go against them with a claim. Only the Java/IE crisis years back was the biggest one.
On top of that in the 80s, you can bet a lot of things were based on previous technology. Things like popular Database and Word processors applications, were all software that were previously made by someone else.
So basically I suppose if you find something, use it! Can't really say that just because you used someone else's idea that it's automatically theirs and theirs alone.
As others have said: (1) rules vary according to jurisdiction; and (2) the details of what you do are likely to be quite important.
I can certainly give you some idea of what the position is from the point of view of English law:
[1] Software is subject to copyright.
[2] There is no such thing as "fair use" (unlike the situation in the US).
[3] Copyright protection extends beyond stopping you making a copy, but includes preventing you making adaptations, which would include (for instance) translating the work into another computer language.
The idea we have "fair use" of any kind is a common misconception. Fair use is a fairly broad idea in US law. The equivalent in English law is a specific list of exceptions where you are allowed to use a work, provided that in addition what you do is "fair dealing". You can find a long list of them in Chapter III of the Copyright Designs and Patents Act 1988 (caveat: that is the act as passed, not as amended).
Your real question is not (I suspect) "is this fair use" but "can I do this?" and that's a more complicated question - which is why others have said you should consult a lawyer about it. I'd agree, but that might seem rather self-seeking (since I am a lawyer specialising in copyright).
But there are other questions, for example: to what extent is taking some pseudo-code and realising it in a programming language an infringement of the original work? Its going to be a matter of degree, but exactly where the line is drawn is not an easy question to answer, and of course impossible in the abstract. Most of our reported cases concern very substantial violations, including taking thousands of lines of code and then using automatic tools to hide the fact that it was copied, eg by renaming procedures.
If by "from Wiki" you mean "on Wikipedia", then that is licensed under CC-BY-SA 3.0. Unless there is something to suggest otherwise, it is probably reasonable to assume that the pseudo-code was written by an editor and is fine to use.
As others have said, just because something appears on a website with a permissive license, does not mean that someone else (who hasn't given permission) doesn't own the copyright. In particular if the work was done in the course of employment, the writer's employer will become the first owner of the work. However s97(1) of the Copyright Designs and Patents Act 1988 is likely to give you a defence:
(1) Where in an action for infringement of copyright it is shown that at the time of the infringement the defendant did not know, and had no reason to believe, that copyright subsisted in the work to which the action relates, the plaintiff is not entitled to damages against him, but without prejudice to any other remedy.
Of course I am talking here about copying code or pseudo-code not about the underlying algorithm. Of course where the algorithm ends and its expression as code begins is something that we argue about a lot and where there is no neat line.
A final point: this is an area of law where, I know for a fact, the English courts have deliberately departed from the approach of the US Federal Courts. If you are interested in how things work here, be very cautious about accepting advice, however well meant, from someone not familiar with the UK.
EDIT I realise that I was looking at the wrong individual when working out where the questioner lived. My apologies. The above may be useful for anyone who is in the UK.
Preface: IANAL
Writing your own code to implement an algorithm is generally OK (by US rules). An algorithm is essentially a generalized mathematical procedure, and US patent law defines math and science formulas as "laws of nature" which are not patentable. Your specific implementation of it can be copyrighted (so people can't duplicate your binary), but if someone else wants to write their own code from the same algorithm there's not much you can do to stop them. Example: if I write a physics engine, you can't copy it; however, you can write your own engine that duplicates the functionality of mine. Nobody can claim ownership over the laws of physics so the basic rules that the engines follow cannot be patented. However, my original work (the source code that implements those rules) belongs to me and I can copyright it accordingly.
If you are working (as you mention) from general algorithms or pseudocode listed on this site or on Wikipedia, then you should be okay (for the most part). Content posted here or published on Wikipedia is automatically licensed under open content licenses that permit others to use the content (see each site for the exact licenses used). As long as the poster wasn't posting code that they didn't have permission to redistribute, then content from these sources is okay to use.
You mention "modification of a C algorithm". If you meant "modification of an algorithm", then the statements of the first paragraph apply. If you meant "modification of a piece of C code", then you will have to check the original code's license. Some source code is licensed in a way that allows unrestricted re-use and modification, some allows modification if you meet certain conditions, and some does not allow modification at all. If the source code you are working from did not include a license, either contact the author and ask for permission or check the terms of the website where you found the code (some include a license that covers all code on the site).
If you even have the slightest doubt about whether you can re-use a piece of code, don't do it. Playing it safe and taking some extra time to work out the code yourself is infinitely more preferable to saving some time and effort now and getting the pants sued off of you in the future. If you really need to find existing code that you can re-use, look either for code written by the US government, it's agencies, or university research projects funded by government grants (all such code is required to be placed in the public domain) or open-source code published under a permissive license such as the BSD license.
To give a sense of how complicated these issues can get, here are a few links to articles describing fair use in the context of software.