As soon as you have written a portion of code, that code is automatically protected by copyright worldwide. Copyright is free; no registration is required; and no renewals are payable. Neither are you legally required to add a copyright notice, e.g.:
"© [Name of owner], [year]"
But, adding this notice to your website and documents is a good idea ‐ it points to you as the owner.
Copyright prevents others from "copying" your code. However, it does not prevent others from "redeveloping" the code. For example: the copyright in Microsoft Word prevents others from copy‐pasting portions of the code. But, anyone may buy a copy of Microsoft Word; see how it works; and try to code a similar product that replicates its functionality. A good example is Libre Writer (think "MS Word"), Libre Calc (think "MS Excel"), and Libre Impress (think "MS PowerPoint") ‐ spot the difference:
And, you can bet your bottom dollar, if Microsoft could have gone after them, Bill wouldn't have hesitated.
So, copyright is nice, but not that useful. What more would you expect? It's free!
Like our page on facebook: