Programming doesn't fit in your brain
“A lot of beginners under-appreciate the degree to which googling things is part of a programmer’s job,” says @steveklabnik #wednesdaywisdom pic.twitter.com/FnXo3rBfPb
— Glitch (@glitch) May 31, 2017
That quote is true, and it's a specific example of a more general principal: get comfortable with not being able to fit everything in your head simultaneously.
Beginners often try to hold whole programs or whole problems in their head. And they start to unconsciously believe that getting better at programming involves being able to hold bigger programs and bigger problems in their heads.
This is a trap.
I suspect that people with incredible working memory are actually handicapped at learning programming, because they can get through most practice problems without ever learning the critical skill of paging things in and out of your mind.
You literally need to be OK with forgetting things in order to free up space, and trust that you'll have a good system for relearning what you forgot next time you need it. Sometimes that involves Googling, sometimes it's a well-crafted search through your code or documentation.
This ability to retrieve information on demand is the underlying motivation for all the things we do to manage complexity. Well-structured code allows you to forget about most of it most of the time, and learn or re-learn individual pieces on demand.
Photo credit mimitalks via Flickr, CC by-nc-nd.