Some good answers so far...
First, regarding books. While the suggestion of avoiding "dumbed
downed" books has some merit it is worth noting the distinction between
books that are primarily used for reference and books that are more
about theory. I haven't fund much use for "reference" books so much as
usually the same material can be found online and kept more up to date.
However, theory books on algorithms and software design can provide a
good background on how, in general, to write good code.
One of the best ways to learn how to write good code is to learn by
example, and one of the best ways to do that is to surround yourself by
others that write good code. Find an area of interest, then look for a
good community open source project, then join their mailing lists, and
become involved with the community. While you probably wouldn't be
making too many contributions to the Drupal core, there is a lot that
can be learned by following the Drupal development community to observe
coding best practices, software design and patterns that experienced
coders use. Drupal is just an example here.
IMHO, a good software application/system begins with a good
architecture, and a good architecture makes it much easier to write