If I wrote a program that solves a problem for my employer, then turned around and tried to sell it to them or get royalties from them, it would be a huge conflict of interest, I’d likely get fired, and they’d take it from me anyway due to standard tech company IP reassignment clauses. But if I’m the CEO i guess it’s totally fine.