I learned to program through online documentation and projects. I also read books but I don’t consider them pivotal to my programming or software engineering career. Some of the books I read are:
Designing Data-Intensive Applications: really good book.
The Mythical Man-Month: felt outdated but useful to understand where the industry came from
Design Patterns, Elements of Reusable Object-Oriented Software: I don’t remember much. I think I read this too early to fully grasp all patterns but at least it gave me a general understanding of Design Patterns