"You can not patent code. You can only patent an invention which is implemented in your code. An invention is a new and unique way of doing something. Most of all, it must be something nobody did before. If anyone used the same technique which you describe in your patent, that's called prior art and invalidates your patent. So trying to get a patent on something somebody else invented and implemented in code would be futile. ..."
No shit. Relevance?