views:

483

answers:

11

If there's an existing website that has the exact feature I'm trying to implement and I can see the implementation by viewing the page source or viewing the included JavaScript files, is there anything wrong with copying it?

+8  A: 

Yes, there is something wrong, unless you obtain permission from the author.

Daniel Vassallo
+1. Generally I think this falls under your standard copyright laws ( http://en.wikipedia.org/wiki/Copyright ). So technically you should only copy their work if you've been given express permission. From a practical standpoint, however, as long as you don't blatantly rip someone off you'd rarely have a problem. Most people know this and do it all the time as a result.
Steve Wortham
+4  A: 

So long as you don't do this -> Microsoft vs. Plurk

Nazarius Kappertaal
"Imitation may be the sincerest form of flattery, but blatant theft of code, design, and UI elements is just not cool" +1
Derek Adair
+3  A: 

That depends entirely upon your ethics :-)

You would be better off actually trying to decide whether or not it was illegal - at least that concept is an easier one to tie down (although it also depends on your jurisdiction - you may not live in a country that even recognises the Berne Convention, or intellectual property at all).

In the US (as an example), you could be bitten by one of:

  • trademark law;
  • patent law; or
  • copyright law.

Keep in mind that this is not legal advice - I am not a lawyer, I am not your lawyer, yada yada yada. As far as advice goes, this is worth every cent you paid for it :-)

You would be unlikely to violate trademark law unless you used a mark in the code in such a way to cause confusion to the market. The chances of doing that with copied JS code are slim.

The way in which to avoid copyright violations is to not copy the code. By all means have a look to see how it works, but re-implement it from memory. Copyright generally covers the expression of an idea, not ideas themselves.

Patents, there's no way to get around them if the code actually uses a patented method. But, in my opinion, most of the JS code I've ever seen is neither novel nor non-obvious, two of the three cornerstone requirements for patentability.

paxdiablo
+1  A: 

If you copy it, make certain that you include at the top the url you got it from, and mention it to the website owner.

You may find that they are not happy with it, so spend time understanding what they did and then use that to write your own functionality, but, if you are open about where you got it from often people are not going to be bothered by it, IMO.

James Black
+8  A: 

It's a gray area. On one hand, you're directly profiting from another person's hard work by taking what they've created and using it. They might be ok with this, or they might not be, it's hard to know. If people explicitly want others to be able to use their code, then they'll often release it under some kind of free or open source license.

On the other hand, the internet is an extremely public place, and anyone who puts up Javascript code onto the internet is generally aware that it is available for all to see and borrow. If you don't take steps to protect it, and it's useful, someone is bound to copy it.

I find that a lot of javascript is extremely site-specific, so you can't directly copy it anyway, it requires a lot of modification to get it to work with your own site. Most authors won't bother to protect it in this case, and they're usually not doing anything ground-breaking anyway.

Generally where you're going to get into trouble is if you take something that's pretty neat and the author is proud of, and put it into a site or product that becomes popular and makes money. The author is going to want a piece of the action.

To remove all doubt, it's best to email the author and ask for permission.

zombat
"On the other hand, the internet is an extremely public place, and anyone who puts up Javascript code onto the internet is generally aware that it is available for all to see and borrow."And shopkeepers are generally aware that having things on shelves makes it easy for people to steal from their shop. But it doesn't make it legal.
mopoke
The internet would be more like leaving your valuables outside on the sidewalk where you can't see them. A shopkeeper can protect his goods with simple watchfulness and the power of the law. You can't protect a web page source without significantly more effort than that.
zombat
Copyright violation is *not* theft, despite what the corporations would have you believe. Theft is defined in law as depriving someone of their property. There is zero deprivation in copying which is why copyright violation is a civil matter, not a criminal one. So you can't really equate the internet to leaving your valuables on the sidewalk unless all people could do was make copies as they walked past.
paxdiablo
Shopkeepers in my neck of the woods do put their products out on the street, with a sign telling you to pay inside (or in some cases, directing you to put money in a jar, and take your own change). It's still stealing if you take stuff without paying, but we tend to work more on the honor system around here. I wish the rest of the world were as nice.
Brian Campbell
@paxdiablo - yes, I agree. Internet metaphors suck. The point I was trying to make was that there's no expectation of privacy once you put something onto the internet, a global public forum, for all to see. There are very few tools to prevent someone from using your works. For the vast majority of javascript code, this isn't a big deal, but that doesn't mean copying it is ethically correct. On the other hand, as a developer with limited legal and technical means to protect your javascript, you should probably realize that people *will* use it if it's useful.
zombat
@paxdiablo: If you take and use my images without permission, you are stealing.
Alan
@Alan - no, paxdiablo is right. That is not theft. It is copyright infringement. There is a significant difference between the two, which is usually lost in today's talking-head media.
zombat
A: 

Legally, I believe so.

although, it is entirely up to the person who coded it. It's best to contact the individual who wrote the code and ask permission or advice on a certain technique or whatever you're stealing.

I do not care about people taking advantage of my previous experiences... To a certain extent that is.

Any good stuff is really difficult to steal anyways.

The more important question is...

why steal something when it is SO much more beneficial to learn how to do it on your own?

copying/pasting code is a dangerous habit to get in

Derek Adair
+2  A: 

That depends whether the code is under license and which one. This should be mentioned in the javascript or html code. If it has one, then that license will tell you if you can copy it freely.

However, even if it doesn't have a license, it's still copyrighted. But there is a difference between copying some functionality, and copying an entire site.

Recently Microsoft China was in hard weather due to outright copying some other asian social website. Most javascript was exactly the same, and the design was pretty similar too. And they tried covering it up by changing some variable names, while the structure was exactly the same.

My impression is that it's ok to copy javascript/html code for a particular functionality (say, a drop down menu), as long as you're giving credits to the authors in code comments. But copying an entire site to build a competing service, then you're on thin ice...

Tor Valamo
+5  A: 

When this happened to me, I contacted the author and asked him if I could use his code. He not only said "yes", but added a Gnu licence to the code so that anyone else could also use it too. There's no harm in asking people, and making a polite request doesn't cost you a penny.

Kinopiko
A: 

I think most script or resource on most website cannot absolutely fit into another. In my opinion, you can learn from that you interest and then absorb their techniques or more to use in your website.

If you want to use other resource (images, ...), the good way is send the owners an email. :)

Tanawat Tassana
+2  A: 

You're not going to get a single "correct" answer on this one. Obviously we can find people who would say that any copying is inherently ethical, other people who would say copying code without explicit permission is unethical, and probably every position in between.

(It's not quite clear from your question, but here I'm assuming that "copying it" means literally making an exact duplicate of the bits, and not just "learning from the strategy some other person used".)

A related question that you didn't ask is: "Is it legal?". If you're in the Berne Union (hint: you almost certainly are), and the author didn't relinquish any of his rights, then it's probably in violation of copyright law. Better ask first.

Ken
A: 

Direct copying without getting the authors permission is most definitely wrong.

Since it is software, you could copy the code, then write your own from scratch (ie not just change variable names, formatting), and use the sample code as a guide, but using a direct copy is wrong.

Alan