This is a great question.
> "You don't need to memorize code. Just Google it".
This is the same as saying "you don't need to memorise english words, just look them up." Just imagine what the flow of the conversation would look like. Or how one would engage in commenting on HN.
> Would like to know how you overcame this?
I guess the answer is the same as with learning any other skill. Practice. In a dedicated learning setting, not at work.
And as a side note, I still believe a formal education, as oppose to self-taught, has some merits.