Most books don't touch on this because it's not the flashy graphics that are fun to program. Yet every game must have some type of resource management system or it will fall apart very quick. The only book I've found so far that even touches this is Game Code Complete, 2nd ed. I wish there was more talk about this important topic but most just assume they can write a robust system. When you actually begin to design and then implement you begin to realize just how complex it can get. I finally had to create a custom templated array that always had O(n) access b/c none of the STL containers offered exactly what I needed.
... Are there any books that actually teach you such guidelines? I've got plenty of books, that teach the API, engine design, collision detection, real time rendering etc... But none mention the little things as you have, otherwise I guess it comes with experience