This article discuss the question of whether a "hello world" program is protected by copyright. It comes to the conclusions that it is not (under US copyright law) because most of it is required by the implementation leaving only the phrase "hello, world" which by itself is too trivial to be copyrightable.
I believe the same reasoning would apply for my jurisdiction which is the UK.
I would like to know how to reason about this. At what point does something become non trivial so that copyright applies?
Things I think should not matter:
- names of variables or functions
- the order of operations where the order does not matter
Things I am less sure of:
- commentary describing what the code is doing
- adding a unit test suite
- adding a build system
I have a specific example in mind but am making that a separate question. The point of the question here is if you are working your employer owns the copyright. Obviously it is correct to ask permission to publish from your employer. This question asks if it is necessary for trivial cases such as:
- asking a question on stackoverflow
- publishing a project or 'gist' explaining how to do something (which might also be an answer to stackoverflow question).
Related questions:
- How can I determine if some code I want to release as opensource is already licensed or proprietary?
- What is defined as trivial code when licensing a project
- https://workplace.stackexchange.com/questions/129053/can-i-adapt-code-i-wrote-for-work-and-release-it-as-open-source
- Legality of publishing code for a stackoverflow answer as an example impementation