This has come up numerous times throughout my career, so I will comment specifically, both neutral, positive, and negative experiences.
I formed my own C-Corporation in 2012, so it’s 12 years old now. I then proceeded, over the years, to create numerous PHP and JS open source packages, almost all MIT Licensed, that became somewhat prolific in the Open Source community (over 1 million installs). https://github.com/PHPExpertsInc/ (currently: 70 repos).
I register for official copyright paperwork for every project that more than 50,000 installs with the US Copyright office.
Most importantly, all of the works are owned by my own corporation, which does pay me a very modest salary for them. Thus, they aren’t technically “mine”, but belong to the C-Corp, which I happen to own 100% of and have full control of.
Contractually, the projects revert back to my ownership and copyright if and when the corporation is ever dissolved for any reason (lack of paying corporate dues, lawsuits, willful ending of the business, etc.).
Pre-Employment Contractual Setup: Most businesses I have started working for over the years have an Intellectual Property Disclosure form, where they want to list the works created by me. Well, it’s quite a lot. I’ve written 5 books (3 currently on Amazon), over 150 open source projects, etc. I list them all, at least in passing. Even when employers do not ask (especially for 1099 work), I submit my own IP document, attached to the final employment documents.
It is literally 3-4 pages of small-font lists of each of the projects with GitHub / Amazon URLs and the year started.
Then I add the blurb: Perpetual license is given to this Employer for use of all of the software developed, maintained, and owned by PHP Experts, Inc., persuant to the open source licenses of each project, if the Employee is permitted to work on the project as part of this employment contract.
I strive to only work on the projects before 8 AM and after 7 PM and on weekends, except for jobs that I put the IP and Contract clauses and I know that they have accepted it.
Neutral Outcomes: Most companies don’t really notice that I use my own software (particularly phpexperts/rest-speaker and phpexperts/simple-dto), especially 1099 short-term contract work. Usually nothing ever becomes of it. I don’t even think people notice.
Positive Outcomes: My current employer embraces open source and realizes that my projects bring about 2,000 hours of free labor from the git-go, and that their other devs benefit from usign my open source projects, too.
I’ve been hired primarily because the interviewers personally used my projects, particularly the bash-timer and BashScripts framework.
I’ve also had two employers that hired me at discounted rates on the condition that I create open source projects for my own company and use them in their own business. But that seems outside the scope of this question.
Negative Outcomes:
Story 1:
Not once, but two times, I have successfully inserted my IP clauses into contract documents but things turned very south. First time, I was working for a lawfirm, and I refused to sign the original employment contract without my IP addendum. It went all the way up to the CEO, himself a contract lawyer. He called me into his office, I told him I brought a lot to the table and he should authorize it, as it would let me help his corp immediately in major ways. He was so impressed that we ended up reducing my expected salary by $20,000 on condition that I could build a completely new thirdparty API client and maintain ownership of it while I worked there (using that API client for the business’ core needs).
These IP things are not standard, and no one, certainly not me, told my manager or other developers about this arrangement.
For more than a year, I brought in over 20-30 of my projects into this org’s existing legacy software and really turned things around. But egos ran hot and heavy and the other devs (I was team lead) greatly resented and viewed it as theft of some sort that I was actively contributing to all of these open source projects of mine in my day to day work (all changes necessry for the company’s legacy software to work, for instance, porting some to work on Windows PHP).
Things came to a head when the CTO found out and I found myself in a dark room surrounded by corporate IP attorneys threatening me with all sorts of nastiness. Then I showed them the IP contract with the CEO’s signature dated before I started working there, with lists of every project that was under contention in that discussion.
The CEO was called in, interrupted his day, he was pissed. He said, yes, that he authorized it, and that I must be shrewder than all of them. The lawyers folded their folders and told the CTO that, well, I was completely in the clear.
The next week, the CIO (my boss) and the CTO and HR met me in the same meeting room and told me that I was being let go for no cause. The CIO’s face looked ashen. He told them all, “Theo has saved this company in the 15 months he has been here. I am afraid we won’t survive 6 months without him.”
That was early November 2019. The CTO ordered all my projects be removed from the website. The website crashed. They missed their Black Friday weekend because the devs who remained were really highly incompetent and couldn’t finish the project in time. Then they missed Christmas. Then in January 2020, they had mass layoffs and laid off basically every competent person who remained. Then COVID hit in March, and they were out of business by May. his prophecy came true.
Outcome 2:
I worked for another company for almost 3 years. A huge Fortune 50. They accepted the IP clause but I didn’t actually work on any of my projects during work, always nights and weekends. I was also 1099 hourly and never, ever, not a single time worked on the clock on my projects (any of them).
I was team lead and ended up integrating about 5-6 of my projects into the app. No one really noticed. I guess they just assumed they were just like any other app.
Then one day, someone on another team at the huge company used one of my more popular projects in their own project, at the company. They had discovered it by accidnet. After a while, someone else realized that I was the author. Egos ran hot, and they found out that I was using it in every project I contributed to over there.
Well, as you can imagine, my manager said he felt betrayed. I said, why don’t you look at the git log and find a single time when I worked on this during working hours? So apparently he assigned some junior dev to do just that.
The junior dev used some sort of tool and sure enough, not a single contribution was committed during working hours over the 3 years I worked there.
Still, they put me on unpaid leave and had legal look at it. Legal came bakc and said, “We found this in his legal contract.”
But I wasn’t hired directly, no no, this company was hiring my company, via another third party recruiter. I had/have Accidental Errors & Omissions insurance, and successfully filed a claim for lost income due to the thirdparty being at fault (breach of contract).
The lawyers swiftly replied that, yes, since my company was the actual employer of me, this was all 100% legal even without a contract in the IP clause (becuase my corporation was paying me in addition to the employer paying my corporation).
SO case was dismissed, the insurance paid out 8 business days of lossed wages, and then the insurance company sent the bill to the Fortune 50, which paid them.
My CTO never ever forgot it and for the next year, he urgently tried to find someone to replace me. More than a dozen coders were assigned to work with me (Team of 1) but no one could cut it, and most quit of their own accord after 2-3 weeks and went back to easier projects. After 14 months, finally someone decently competent could actually do about 20% of the amoutn of work I was doing.
3 months later, I was gone. Contract terminated early, with penalty payment. On my last day there, the product manager told the entire division (some 100 people) that he didn’t know how the project would survive long-term without me. Actually, 2 senior devs jumped ship when this was going down, sensing that the project would die. Five months later, he was proven right and the company had to hire an additional 20 testers to replace the product I had single-handedly maintained for 3 years.
But yeah, work for your own c-corp and bring in projects that you started before this new employment, and insert an IP Disclosure paper into your employment contract and you should be good to go.
Oh and never work on your own stuff on company laptop, and try to work off-hours.