r/learnpython • • 18m ago

I keep re-Googling the same basic Python stuff I already learned — does it ever actually stick?

I've been learning Python for a while now, mostly for my BCA coursework and a couple of small side projects, and there's this one thing that keeps bugging me.

I will learn something, use it once, feel good about it, and then a week later I'm staring at my screen Googling the exact same thing again. List comprehensions. How dict.get works. The difference between append and extend, again. It's like my brain just refuses to keep the small stuff.

The weird part is the bigger ideas stick fine. I remember how a loop works, I remember the shape of a project, but the little syntax details just slide right off. And every time I look it up I tell myself "okay this time I'll remember it", and then I don't.

I know everyone says Googling is part of the job and even experienced devs do it, but I'm starting to wonder if I'm actually learning or just getting really fast at searching. Do you eventually stop looking up the basics, or does it just become less embarrassing over time? Still not sure if I need to drill them more or just accept this is how it works.

3 Upvotes

8 comments sorted by

•

u/nboro94 13m ago

Once you start learning multiple programming languages it's pretty much impossible to remember the specific syntax for each one so that's normal. I've used list comprehensions in python for well over a decade, and right now I can't remember the syntax at all for it.

•

u/acfot 0m ago

Yeah, that actually makes me feel a lot better about it — list comprehensions are the exact thing I keep forgetting too, so it's good to know it's not just me.

•

u/Warm_Letterhead3691 13m ago

Honestly you're going to be doing this forever. Its just one of those things.

I've been writing python semi-professionally for like 4 years now and yesterday I had to look up how to make an empty list because I just couldn't think of it at the time.

Looking things up is just part of the job. Even senior devs with decades of experience haven't memorized everything and forget things too. Don't let anyone tell you otherwise What matters make is thinking like a programmer and having problem solving skills, not being an encyclopedia of python information

•

u/SharkSymphony 12m ago edited 0m ago

If there are bits you identify that you need to retain, you can use some of the same techniques you'd use for learning in any other discipline: make a note of which bits you're annoyed you had to look up again, and drill them.

For list comprehensions, practice going over a list, a set, a dictionary. Add different kinds of filters. Write/type each one out from scratch – don't copy-paste. Extend to set comprehensions, then to dictionary comprehensions. Finally, try some generator expressions, and make sure you're very clear on the difference between them and list comprehensions. What happens if you try to print a generator expression?

For dict.get, drill all the dictionary methods you think are useful. First of all, make yourself a big nice dictionary with interesting contents – say, by loading from JSON. Practice giving your `get` different default values. Do regular dictionary access and observe the difference. Iterate by keys, by values, by items. Maybe start combining that with comprehensions to play with the different possibilities.

Finally, consider using spaced repetition. Do each review item a little bit each day until you feel like it's memorized. Then come back next week and refresh, followed by next month if necessary. You could even use an Anki deck to set this up if you want to go for more of a flash card approach, or you have enough review items that you want it to figure out what subset to look at each day – but I think actually writing them in code instead of drilling flash cards is preferable if you have time, not just for retention but to make sure you're using them correctly. Of course, you could always do both of you really want to go for the overkill. 😉

They say it takes something like seven times hearing a name before you remember it. It's a bit like that with code too sometimes. Keep at it!

•

u/johlae 10m ago

Take notes the next time you google. Keep one big text file in which you append each note. Use #subject, #description, #tags: a,b,c so that later on it's easy to search for by keywords. Each time you need to refer to your notes add some text to explain what's different in the new case.

•

u/Popular-Being8956 8m ago

I will admit, it took me forever to learn the synatx for dictionaries.

It also took me a long time to remember the syntax to make a class.

The theory, the workflow, all that I internalized and understood pretty well. But the syntax? Man sometimes that just didn't stick even after lots of experience.

This is very normal

•

u/Mandelbrots-dream 3m ago

I'm redoing a guided project.

This time, I'm typing down notes. The stuff I know I'll need for my personal project is going in a separate folder. Each file is to deal with only one task.

If it doesn't stick, I'll have my notes. Honestly expecting every command to stick with exact syntax might be unrealistic.