This is both an ethical question AND a legal question. Based on how you layed it out, it can't be one or the other.
As far as I see it, here are the important issues:
1.) Ethics: If you are on company time, its company property. In today's legal climate, that means its the company's property (IP wise).
2.) Is the current IP system ITSELF ethical? If you think it is in fact ethical, then any work you do with even the faintest notion of a company application is the company's property - regardless now generic or obvious.
Why? Because right or wrong, that is the current standard when it comes to IP - concept and being the first to file is all that matters. Therefore, ethically speaking, its wrong to 'rob' your company of an idea. If you were thinking of an idea, off company time, that you were considering for modeling reasons, in the context of the company, its company property.
It could be something as fundamental as adding int x and int y together, but if its in the context of the company's methods, all of a sudden its a patented business process.... unless someone who knows the patent has been filed points out the obviousness and prior art against it.
A more personal example: Perhaps someone has one copywrite a description of how to hold your penis so that when you pee in a urinal, you don't get anything on yourself. Now if you teach your son using these words, you are in violation of a copywrite and can be sued. Ridiculous yes?
Or even better, a more generic patent that describes a method for avoiding urine splashing by directionally holding the penis toward the porcelain before, during and after urination followed by the act of shaking the dew off the lilly. Now its more generic and to avoid violating that patent, you have to sit down when you pee.... forever (or 75 years after the corporate dissolution of the holder of said patent - effectively the same as forever)
But not we have to go through costly litigation to have this patent invalidated... while the patent office has the motive of interest in not looking like an idiot.
So here we are in court - trying to prove that holding your penis while peeing has plenty of prior art and that its obvious... but the legislature has company x making donations so they don't mind.
Also consider that the court 'gets' the peeing concept but isn't capable of seeing that computer code is, in context, the same thing.... they are being lobbied all day long anyway.
So we have point 3...
3.) Is a system that rewards such behavior that basically becomes nothing more than a 'who can afford court costs the longest?" ethical? Is such a system meant to reward ideas on their merit ethical when in the end it rewards not innovation but the biggest bank account and the best lawyers? Is it ethical to obey and respect a body that cannot fill its own ethical responsibility to the people?
4.) Does a system of granting patents and the organization that does so, with a history of 'obvious' patents and scrutinize by industry professionals, academic research and prior art, yet grants them anyway deserve, ethically, any respect?
Isn't that similar to claiming that its unethical to say ignore English tax law because it WAS the law at the time? Didn't a more 'ethical' change OF the law require subverting it with the Boston Tea Party?
If a principle event in the founding of America was unethical, aren't any laws established BY America also unethical by extension?
If those laws were unethical, isn't the ignoring of law that is seen by the masses to be unethical and ethical act in an of itself?
The law always supports its own ethics and abhors as unethical anthing that disagrees.
However, to change the law, an ethical challange must happen and when it does, by definition, when compared to current law, the challenge is unethical.... That doesn't mean the challenge is wrong or that the law won't change.
To challenge the prohibition of alcohol was unethical at the time - it was against the law. However, when it was turned down, the same practice (drinking and trading alcohol) was instantly again an ethical practice in that it didn't violate the law. hmmmmmm.... Seems to be more about interpretation and opinion rather than some absolute reality does it not?
In theory, if 51% of the population 'pirates' music (ie - commits a civil copywrite violation for a download) society has collectively said that its unethical to consider such acts to be against the law - that concept is in the constitution.
5.) Since if say 51% of the population violates current IP 'writes' without consideration, isn't it unethical for the government to still consider such acts a crime in the first place?
Who does the government answer to? Corporate interests or the people? Isn't it unethical to consider any other opinion than the will of the people, in this case spoken through action?
____
Talk about ethics.... man, funny how ethics changes depends on the application of the term based on who is defining it in the first place don't you think?
That said... All code I write is signed with my own copywrite.... If its not challenged, its mine and if it is is still mine until a court says otherwise so whatever. I got their first. I'll use it for my own interest, commercial and personal.
If your business depends on the specific character per character strings in my code rather than what they actually do, well, I'm glad I'm not in your employ anymore.
If your business depends on the process my code does (now were into patents), again, I'm glad I'm not in your employ anymore.
If I loose the patent suit, ok, fine. If I loose the copywrite suit, I'll just write different code that does the same thing and be fine.
If you depend so much on your specific code rather what what you accomplish with it, you deserve to die and 'ethical' opinion is agreeing with me more and more over time.
When I write code, its mine. When I apply it to business, it is effectively licensed to the business GPL style for eternity. I however own the code and all rights to it.
Don't like that? Ok... Your competitor has agreed to those terms.
Make a decission.
You own the right to use my work however you see fight. That is ethical.
You do no own the right to the intellectual results every time one of my neurons fire. That is unethical.
To claim intellectual property rights over ideas I have, when I cannot control when they happen. To assume that for this reason, all ideas are the companies even if they happen on off time, because it MIGHT have been related tangentially to a work project or could in principle be applied to a work project is to claim intellectual slavery on people with ideas just because they work for a given company.
Any and all thoughts made are company property... Your mind, your thoughts, your ideas are not your own - they are owned by a piece of paper known as a corporate charter.
That idea is THE most unethical one mentioned.... and its really scary.
Ironically, here we are having a discussion about ethics.