If this were true of copyright, we would’ve run out of permissible novels a long time ago. There’s plenty to complain about with how software IP works, but copyright seems pretty sane. The alternative of protecting IP via trade secret is not a world I want to live in. That seems bad for open source.
The central idea of programming languages is that the grammar is very restrictive compared to natural languages. It's quite likely that, with the exception of variable names and whitespace, some function you wrote to implement a circular buffer is coincidentally identical to code that exists in Sony's or Lockheed Martin's codebases.
Plus there's the birthday problem -- coincidences can happen way more than you expect. And even with prose, constraints like non-fiction can narrow things down quickly. If everyone on HN had to write a theee-sentence summary of, say, how a bicycle works, there would probably be coincidentally identical summaries.
Aside from obligatory syntactic bits, what is the most common line of code across all software ever developed?
It'll probably be C or Java. HTML doesn't count.
And it's probably something boring like:
i++;It was ASM code I think, and their defense was that there was basically one way to write a function that does this.
Even if a programming grammar is more restrictive, there’s some length where things become almost certainly unique.