There are perfectly good programmers who haven't picked up a book since they graduated, unless it was to prop up a monitor or build a shelter from Nerf darts. There are a lot of great online programming resources, but personally, I couldn't survive without my books. When I encounter a new topic, the first thing I do is track down a good book about it. Mmmm... tasty hardcover brain food.
Programming is a topic that gets a huge section at the big bookstores. Buyer beware however, not all of those books are worth your time or money (mini-rant: do nearly all computer books really have to cost over $50?). To help you avoid the duds, I'm posting short blurbs about some of the better books that have collected on my shelves over the years. Some are specific to games, other are broader programming books I've found to be relevant to game development.
To kick things off, here's a short list of solid general programming books:
By Steve McConnell
Code Complete is an essential book for programmers who have learned how to program, but don't have as much experience with the complete software life cycle of full-scale projects. It's filled with lots of good practices for everything from planning, to design, coding style, performance, debugging, and maintenance. The author also includes plenty of references to other good programming books to bulk up your brain.
Even if you don't agree with or adopt all of McConnell's advice, these practices show up in other people's code, so it's good stuff to know.
In short: The professional programmer's tour guide.
By Gamma, Helm, Johnson, and Vlissides
This one is a classic for object oriented programming (OOP). It's not for beginners, but if you've already got the basics of OOP, Design Patterns will save you from reinventing the wheel.
DP is presented as a catalogue of proven OO design solutions. Some seem obvious at first glance, but if you really dig into them they reveal a lot of depth in the details. Even if you rarely do any heavy duty design work, being familiar with the design patterns in this book will help you find your way around other people's code more easily.
In short: Read it, or else.
(...or else skim it, it's good as reference too)
Refactoring: Improving the Design of Existing Code
By Martin Fowler
Proper refactoring is about safe transformations you can apply to code to improve its quality. It's a great strategy for those situations when you've inherited a horrible code base (or let's face it, maybe you helped build it), but can't afford to throw it out and start again. Refactoring is not just for salvaging bad code though, it can also be applied to good code to make it better. This book is similar to Design Patterns, in that it provides a catalogue of refactorings for you to use. Good for reading, great for reference.
In short: Friends don't let friends talk about "refactoring" without reading this book first.