I've learned a lot of what I know just using "learn by doing" principle. I think I retain a lot better this way. However, you can only go as far with learn by doing principle as far as you need to "do". Meaning, you might never have to worry about memory optimization or thread locking strategies unless and until you need to.
The field of "programming" can be very wide, so technical books sometimes help fill those gaps to give you an head start when you end up having to "learn by doing".
I don't really think its a waste of time. However, in my case, unless I get to apply what I learned or read, I will likely forget it. So my one tip would be to ensure you pick up books in areas a little closer to your personal or work projects.
YMMV