How do you update code printed in a book?
If a book can be written in such that it does not need to change, then by all means, carefully proof and test all the code and hard code it into the book.
But that's simply feasible in many cases.
Better a book with some external resources than no book at all?
(Oh, and let's set aside the cases where the links to external resources are done in a horrible, broken, poorly conceived way. That's frustrating, but it's not like a book with no external resources produced by those authors/editors wouldn't still be horrible, broken, and poorly conceived.)