To extend let's change the field a bit: Imagine you are a scientist working in a lab, employed to develop new technologies. One day you're falling in the shower and scribble an idea for a flux capacitor. Could you patent it? Or the company? What if it happens in the office? If that makes a difference: How to prove? Most employment contracts (at least the ones I have seen) make the assumption clear, that all results of "software development" are treated as work for the company. Many companies than have ways to allow hobby projects info uelds different from the actual work (while that definition is quite unspecific and has to be decided case by case)