"Borrowing" code

N

Novice

I'm curious to know the legalities involved in "borrowing" code
without paying for it.

Let me clarify. Let's say that I find some code snippets or even
entire classes, displayed on websites and that it would save me time
and money to use those classes in my own projects. This web site,
www.java2s.com, is just one of many such web sites on the Internet, as
is the Java Tutorial at the Oracle website.

Assuming I make no claim that I am the author (by leaving the @author
Javadoc tag empty), am I "stealing" this code? What if I cite the
author name in the @author tag (or the URL of the webpage in a comment
if the author's name isn't present in the code)? Or would I have to
get written permission of the author or website to use the code? Or
even obtain a licence before I can use the code?

Code published in web pages or newsgroup posts "feels" as if it should
be in the public domain but I think that's just wishful thinking on my
part. Given that you can look at it without paying anyone for that
privilege, and copy it into your own IDE and try it, etc. it feels as
if it is there to be used. But as I understand it, those who create
written works, whether books or programs, are their owners (unless in
the employ of others) and retain copyright on this work, a copyright
that typically lasts for the developer's life plus 70 years.

If copyright does apply to all these snippets and example classes,
would I be able to bypass copyright by modifying the code in some
small way - maybe just with some comments or different variable names
- or would that be the equivalent of painting a stolen car: it doesn't
negate the fact that it's stolen and just tries to make it less
obvious?

I've been banging my head against a wall for a while on a couple of
classes my project needs and I have found two perfectly good classes
that meet my needs so I'd like to use them rather than put still more
time into making my own classes work satisfactorily. I'd like to
figure out what I can do to use the clases I found without having to
look over my shoulder (or fight my conscience) on the question of
"stealing" this code.


This thread has gotten WAY too big to respond to each and every comment.
Let me just thank each and every one of you for your remarks on the issue
I raised. I also want to acknowledge that I muddled my views on how
copyright law SHOULD work with the way it actually DOES work in some of
my remarks.

For what it's worth, I studied the code that I wanted to borrow to see
how the author accomplished what I wanted to do, then revised his
technique substantially. I think mine may actually be more efficient and
I'm confident it is considerably clearer. Therefore, although I have tha
author's permission in writing - I'm assuming an email is sufficient to
constitute "permission in writing" as opposed to a notarized paper - I'll
be using my own code in my project.

And, going forward, I will be guided by the copyright notices that appear
in the code that I see and observe them as scrupulously as I can.

Again, thank you all for your remarks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

borrowing Constants 22
Can't understand code 2
Code efficiency 3
AttributeError in pygame code 4
Problem with code 2
Age gate code 0
Help with code 0
Who are low code solutions designed for? 1

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top