Why intellectual property and not just trade secrets? Why are intellectual property rights necessary when nothing prevents a company from having trade secrets?
Trade secrets must be kept secret. There are plenty of intellectual properties that can't be kept secret. The most obvious ones would be a writer, musician or composer - the whole reason for their work is to publish it and make it available to as many people as possible. How could that possibly be a trade secret? Similar with trademarks. The whole point of a trademark is to be widely visible. And there are patents. Here the situation is different. Before patent law, inventors kept their inventions indeed secret. Then people realised that this secrecy is in the way of progress. So patent law was created, which gives an inventor rights beyond those of a trade secret, at the cost of having to publish their invention. Even if you invent today, you have the choice of keeping your invention secret and relying on trade secret law, or patenting it and relying on patent law. Again, some inventions are clearly visible. When the bycicle was invented, it was clearly visible to everyone and couldn't be kept secret.
The legal issues are too black and white to have any meaningful impact on an ethics discussion. The IP belongs to A and B can't use it. A's not planning to build a product around the patent is irrelevant to the law and I do not see it bring up any ethical issue, but some people who do not understand patent law might. There might be ethics issues if A hired Josh with the specific plan to fire him as soon as the application was filed and intentionally misled him about these plans. Another issue might be Josh's duty to not disclose A's confidential information (the application does not become public right away), and Josh's duty to not draw B into developing an infringing product.
It depends on what information you are sharing, how you got it, and what rights the business asserts over the information. For example, if it is content created by the business and they claim copyright protection you can only use it without their permission in accordance with Fair use exceptions. If you obtain the information through some limited/conditional access agreement you would be subject to the terms of that agreement. As always: If you want a legal opinion specific to your use case you need to consult a lawyer in your jurisdiction.
A substantial part of the value of the goods and services provided by tech companies is in intangibles. For example, this analysis suggests that approximately 1/3 of the price of an iPhone is in materials and labour and the rest is in the patents, copyrights and brand value that the names "Apple" and "iPhone" provide. If these intangibles are owned by, say, Aplle (Ireland) then Apple (USA) will have to pay them to use them - whatever amount those two companies agree on will reduce Apple (USA)'s profit and raise Apple (Ireland)'s profit - the tax rates in each of these countries is not the same. Now, tax law says that such transfers have to be at fair market value. So, what is the fair market value of all the IP needed to build an iPhone? Or the value of the names "Apple" and "iPhone"? You don't know, I don't know, Apple doesn't know and the tax authorities don't know. Whatever figure they pick is defensible as "fair market value" because there isn't actually a market - fair or otherwise. Resteraunts can do this too - McDonald's (Australia) pays a licence fee to use the name "McDonalds" but this is the only intangible McDonalds have - there is no patent on how to make a hamburger - so the scope for them to take advantge of this is less than for tech companies.
If you aren't including those libraries, then yes because it's entirely your own work. If you are publishing those libraries, then no because their licenses will limit how you can do that. GPL's and MIT's main features are restricting how you can distribute software that includes the licensed code, and they don't allow the &quot;do whatever you want&quot; of public domain.
If you are producing and selling it, that is an absolute bar to patentability by anyone else (this is known as prior art). So if you are using it very publicly before they file, they can't get the patent.
If an employee takes home information that his or her employer considers confidential, that would be a matter of company policy. The employer could discipline or fire the employee if it learned of the incident, and chose to act. If the information is considered to be a trade secret, or part of one, disclosing it or mishandling it so as to risk disclosure could be a crime under US law. However, only in unusual cases is criminal action taken on such matters, normally it is left to civil lawsuits or internal company action. I do not know if Canada has a similar law.
Can you prevent the government from using your patent? The opposite is actually true. If you patent something, and it is felt to be potentially of national security interest, then they can take your invention for the nation, produce it, and prevent you producing it or sharing the design indefinitely (though it will be reviewed annually). This has happened to about 5000 patents so far. https://www.wired.com/2013/04/gov-secrecy-orders-on-patents/ Even where it is not of national security interest, and the government (or its contractors!) is not using it directly as covered in user6726' answer, they can still take your patent under the equivalent of eminent domain... well, I'll quote from http://patentplaques-blog.com/eminent-domain-excercised-on-patents/ During World War I, the military took all patents relevant to wireless technology and put them in a mandatory licensing pool. Anyone was then able to use the patents and the patent holders received royalties. The pooling of the patents led to innovations including the mass production of vacuum tubes and a national FM radio network. So, in short, the government can use your invention for its own purposes; it can prevent you from using it; and it can force you to give it to others. They don't do this too often, but if you're working in an area that you think will be of especial interest to them, it's something to be aware of. In general, they will compensate you somewhat for your trouble, but not as much as the open market could have.