To the point with Harry Potter: you can think of a continuum of infringement. If you tear a page out and copy it, you will violate the copyright. If you reuse characters or scenes and use them to create your own work, you are making derived works (JK put her stamp of approval on non-commercial fan fiction by the way). But the farther you get away from the original characters the less you can call it infringement. As the link between the two works becomes more and more abstract and less concrete, the new work is more protected. At some nebulous point it is no longer infringing.
For instance, Harry's story and appearance is superficially similar to an earlier work called The Books of Magic, a comic series by Neil Gaiman. You can read his take on it here:
Essentially he throws up his hands and says "borrowing is a fact of life in genre fiction. Deal with it, I did."
How does this apply to computer code? Well, the farther away you get from the original copyrighted code, the less infringing it is. There are extremely limited protections for derived works that amount to Person B having a copy of Person A's code in front of them and editing it.
What those Touretzky pages from CMU show is that there is no such thing as a continuum from computer code to an uncopyrightable abstraction. It is abstraction, mathematics, numbers all the way down. In fact, it is speech that is protected by the First Amendment and suppressing it is a constitutional issue with narrow exceptions.
So no, you can't use a book model for code. It is not the same thing at all. Executable ideas, math, algorithms, just don't exist in the fiction publishing industry.
As for copyright protection, you should reflect on this page:
http://www.cs.cmu.edu/~dst/DeCSS/Gallery/index.html
And then this one:
http://www.cs.cmu.edu/~dst/GeoHot/
To the point with Harry Potter: you can think of a continuum of infringement. If you tear a page out and copy it, you will violate the copyright. If you reuse characters or scenes and use them to create your own work, you are making derived works (JK put her stamp of approval on non-commercial fan fiction by the way). But the farther you get away from the original characters the less you can call it infringement. As the link between the two works becomes more and more abstract and less concrete, the new work is more protected. At some nebulous point it is no longer infringing.
For instance, Harry's story and appearance is superficially similar to an earlier work called The Books of Magic, a comic series by Neil Gaiman. You can read his take on it here:
http://journal.neilgaiman.com/2008/04/fair-use-and-other-thi...
http://en.wikipedia.org/wiki/The_Books_of_Magic
Essentially he throws up his hands and says "borrowing is a fact of life in genre fiction. Deal with it, I did."
How does this apply to computer code? Well, the farther away you get from the original copyrighted code, the less infringing it is. There are extremely limited protections for derived works that amount to Person B having a copy of Person A's code in front of them and editing it.
What those Touretzky pages from CMU show is that there is no such thing as a continuum from computer code to an uncopyrightable abstraction. It is abstraction, mathematics, numbers all the way down. In fact, it is speech that is protected by the First Amendment and suppressing it is a constitutional issue with narrow exceptions.
So no, you can't use a book model for code. It is not the same thing at all. Executable ideas, math, algorithms, just don't exist in the fiction publishing industry.