[In a series of posts, we will identify some legal issues related to software. As we grow up our tendency to ask questions goes down. For example, have you ever asked anyone what's the difference between an R or a TM written with a company's logo? Most of the discussion will be based on US laws but I'll really appreciate if somebody shares his/ her knowledge about Pakistani law (or Pakistanian law, as the rest of the world calls us) in this regard.]
Copyright Law was designed to protect expression of ideas such as a story or a pencil sketch in tangible form. A copyright gives the author exclusive rights on copying a particular way of expressing an idea. The ideas themselves are not protected. Anyone else can also (independently) come up with the same style of expression or use the idea in a different style/ form. Certain works can't be copyright-ed such as "Twinkle Twinkle Little Star." Such works are considered to be in public domain. However, copyright law allows copying for purposes such as education, criticism, comment, news reporting, etc. But this can be exploited. See, for example, the copyright notice at the end of this Matrix Reloaded Transcript. In my opinion, the "fair use" clause is a loophole in copyright protection which is a necessity as well. Comments?
The first step towards getting a copyright is to mark your work with a copyright notice (each copy must be marked with ©, the word Copyright, the year and the author's name). In order to settle disputes in court you should also register your work with a Copyright Office. But it's not a requirement. There is a good FAQ on copyright available here.
As opposed to copyright law (which was made to protect works of art in the first place), patents are intended to protect innovations/ scientific work. While a copyright can be held by two people who came up with the same expression independently, a patent is awarded to the person who came up with the invention first (regardless of who filed it first). The process of getting a patent is a bit more involved as the Patent Office must check all the past works in that field of work.
As you can see, a patent is the most fatal for competition. It gives you the right to exclude others from making or importing a similar invention. That tells you why hackers are against ePatents. A patent, however, is valid for a more limited time (usually 20 years or less). A rather funny quote about kernel optimization patents is attributed to Linus Torvalds:
Do not look up any patents on principle, because (a) it's a horrible waste of time and (b) I don't want to know. The fact is, technical people are better off not looking at patents. If you don't know what they cover and where they are, you won't be knowingly infringing on them. If somebody sues you, you change the algorithm or you just hire a hit-man to whack the stupid git.
A trade secret gives a company a competitive advantage over others. For example, a particular recipe is a trade secret because if it gets known to a competitor, it will cause severe loss to the business. Keeping the secret is the responsibility of the owner. Almost all employment contracts in software houses require a non-disclosure agreement just for that purpose.
A trade secret lets you sue a competitor who tries some unlawful method to get the secret. However, reverse engineering is not prohibited by the trade secret law. And software can be reverse engineered. It also doesn't cover copying issue.
Despite the short comings, it is very suitable for declaring an algorithm as a trade secret. An algorithm is an idea. Software is an expression of that idea. You can protect software by copyright law but not the algorithm. A trade symbol or a service mark is just a symbol such as a logo.
A much more detailed treatment of the terms is available at Wikipedia.
Look very closely at the Microsoft logo when your Windows machine boots up. Does it have an R or a TM at the top right?