In most countries (I'm not familiar with Dutch law), including the two I've worked with in the EU, the company would most definitely still own the code he wrote using company resources and on company time.
Probably not unless his contract was written in such a way. If for example you wrote a personal email using a company computer while at work, you would still own all the rights to it. Your work contract will specifically say what rights you assign to your employer and the specific works it covers.
Legislation in the UK creates a presumption that unless otherwise stated, first ownership of copyright works created in the course of employment will vest in the employer. So it is up to the written contract to rebut the presumption.
It's worth noting "course of employment" is different from "time at work", as it's defined by the tasks you're hired to do. If the person in this article was in the UK his data-entry contract could well be drafted in such a way that writing a program for the purpose of automating his job would fall outside his specified work duties.
Good point. It does depend on the terms of the contract, but "course of employment" is defined quite widely so if the contract was silent, there would be an arguable case to say the presumption kicked in as the work was done for the benefit of the business, during work hours, and at the company's premises (as far as I'm aware).
Fascinating. I've never thought of this. What is the law in the US? If I e-mail a friend during work hours (or write this comment during lunch), does my company own the rights to this?
If you were hired to do some work, the result is "work for hire" and the copyright resides in the company. If you write software, emails, etc unrelated to your job you would ordinarily retain copyright to those. Cases like the one in the story are rather ambiguous. That's employment agreements almost always elaborate on the topic, saying that, for instance, code you write on company computers or on company time belongs to the company.
How is it best to avoid issues like these without having to get approval by a 3rd party? Is coding it at home and sending it to one's office email address enough for documentation that it was done in non-office time?
It's not even a matter of developing it on non-office hours using non-office equipment. Clauses are usually more broad to stop someone from creating a competing product, even when not on company time. Having built an app designed specifically for company systems, the company would likely have a legal claim against the invention, even if it were developed outside of office hours.
I can see that problem for a situation where the outcome turns into a marketable product. But in these automatization cases it looks more to me like when somebody running a horse-drawn carriages business starts suing an employee for working in his free time on developing a car. The skills by the employee applied to solve the problem seem often unrelated/overqualified for the reason they were hired.