6

I'm confused about a copyright issue on Stack Overflow. Can anyone please tell me clearly about copyright on Stack Overflow?

Meaning, if I just copied 10 – 15 lines of code, will it create trouble for me?

I'm not in a company. I'm a student of age 15 years, am developing an application in Visual Studio 2019 Community Edition (not a school project), and want to release it commercially. My application is not open source, but free.

Encrypting connectionStrings section - utility for app.config

One answer on that post worked for me. Should I copy it?

10
  • 6
    But I'm not sure what you mean. You mean you copied code from an answer in your commercial product? That is completely fine. Commented Jun 27, 2020 at 16:13
  • 5
    meta.stackexchange.com/questions/12527/… Commented Jun 27, 2020 at 16:13
  • 4
    @ShamPooSham: It's not completely fine to copy code from SO to a commercial project. You have to provider proper attribution and if you "remix, transform, or build upon the material" you have to distribute your project under the same license as the original. Whether fair use applies can only be answered for a specific case by a lawyer.
    – BDL
    Commented Jun 27, 2020 at 17:06
  • 2
    10-15 lines? You should, and I mean you really really should be able to re-write that!
    – TaW
    Commented Jun 27, 2020 at 17:52
  • meta.stackoverflow.com/questions/286582/…
    – GSerg
    Commented Jun 27, 2020 at 18:18
  • 1
    Also covered by the official Stack Overflow blog: Good coders borrow, great coders steal (2020-05-20) Commented Jun 27, 2020 at 21:23
  • 3
    I’m voting to close this question because it is asking for legal advice regarding copying software. Commented Jun 28, 2020 at 18:01
  • 1
    Meta Stack Overflow is not a place to go for legal advice. If you have a question regarding the legality of an action in regards to software published on Stack Overflow, hire a lawyer. If you are underage, seek the help of an adult, who should enlist the help of a lawyer. If you take the advice of any answers posted to this question, even with caveats, you are taking a risk. You should have all of the facts, including those legal facts that are relevant to where you live, that random people on the internet cannot (and should not) give you. Commented Jun 28, 2020 at 18:08
  • A summary of most common licensing options: gabrielmoraru.com/software-licenses-are-complicated
    – IceCold
    Commented Mar 17, 2023 at 8:12

1 Answer 1

6

As long as you follow requirements of the license (https://stackoverflow.com/help/licensing) - which is essentially give proper attribution - you should be fine* from legal point of view.

To your actual question: One answer on that post worked for me. Should I copy it?

The answer is basically always NO. You should understand it and write your own version that fits into your code - read official documentation (which in a large number of cases - including the one linked in this question - will have the code from the answer under even more permissive license anyway), add logging, error handling, update style, variable names and so on.

If you decide to copy the code as-is make sure to understand whether what you provide to customers considered "source code" or not. With compiled languages like C++/Java/C# compiled program will not have source, but in cases of JavaScript for example you likely "ship" the source code - in some cases license/attribution is needed even for minified versions and definitely should be present in non-minified files.

Even if you rewrite the same code yourself consider to add a reference to the SO question - it will likely save you days later when you try to figure out what this code is doing.

And if you think "no one will ever find out" - please take a moment and decompile the program you plan to give to customers. It is pretty much guaranteed that at least function names would be there - if the code your copied had "Bamboozle13" as a function name it is extremly unlikely you'd come up with such exact name yourself (especially if this one would stick out from all other names your code uses). As a side effect this may also save you from embarrassment of using swear words in method/class names.


*Please note that this is not an actual legal advice and if you are really concerned about it contact lawyer.
3
  • I'm not in a company. I'm a student of age 15 years, am developing an application in Visual Studio 2019 Community Edition (not a school project), and want to release it commercially.
    – user13824586
    Commented Jun 28, 2020 at 9:18
  • Would writing my own version of code removes the copyright issues?
    – user13824586
    Commented Jun 28, 2020 at 9:31
  • 2
    Writing your own original code is not copying. But typing in someone else's code >is< copy as far as copyright law is concerned. And copying the code with variable names changed or something similar is >also< copying.
    – Stephen C
    Commented Jun 29, 2020 at 11:16

You must log in to answer this question.