How does DNA still work after recombination?
One must always be careful not to stretch an analogy further than it can withstand, but since you started these analogies, I will follow up on them and explain the small mistake you've done in their representations.

The two books are not as different as you have in mind. You are not pasting the beginning of Uncle Tom's Cabin with the ending of Harry Potter but only the beginning of Harry Potter with the ending of another Harry Potter in which Ravenclaw is renamed Eagleclaw.

Also, unlike in books, there is no beginning-to-end reading frame for the entire chromosome. There are just genes randomly placed along chromosomes. The reality is that the placing is actually not that random but assuming it is can give you a sense of why it can often be fine to recombine two chromosomes and end up with still functional chromosomes.

For the computer program analogy, it would be like swapping files between branches of the same project (thanks @IronSean for his comment).