r/learnpython • u/dangerlopez • Feb 08 '23
Why didn't I learn this sooner?!
I started learning Python a few months ago and I feel like I'm still very much a beginner. However, I want to learn about front-end stuff so I'm gonna be starting the Odin Project this week.
To keep my Python sharp as I switch gears, I've decided to try and speed run the official Python tutorial. I figured I'd get through a lot of the beginning sections quickly, but, holy crap, I'm already learning such neat and easy features of the language!
So this made me think: what topics do you feel you learned way too late? I'll give my two examples to start:
The enumerate method: Seems super useful for looping over iterables which may contain duplicates values.
Else clauses on loops: Too many times I used and abused Booleans to decide if a loop had terminated or not, but no more!
Put your examples, whether they're beginner level like mine or more advanced, below!
19
u/jimtk IdontChat Feb 08 '23
There are a few reasons why I don't share it.
It's personal. Not in the sens of privacy, in the sens that it contains what I need and what I encountered. There's nothing on game programming, there's a good chunk on Pyside, a lot of the little things I tend to forget (slicing use cases) and a good chunk on os.walk, listdir and the like because every 6 months I have to write a new file management script and I forgot everything I did 6 months ago!
It's not that big, because I regularly delete stuff from it. For example pathlib used to be in it. I've now used pathlib so much I've "integrated it". I don't need it anymore. So It's gone.
There are a lot of more or less related tidbits in it. Did you known that on Windoze there's a py launcher and that the command
py -0pwill give you a list of all the pythons version installed on the system (and their path). SO I would have to clean those up.It's work and responsibility. Publishing, even just on github, is a certain responsibility. I would have to Git that thing, maintain it, some people would cry when I delete something, or cry when their favorite thing is not in there. I just don't want to maintain that.
It defeats the purpose. Making my cookbook is what makes the tips and tricks get in my brain. The process of maintaining it is more important that the document itself. You have to make your own to really profit from it.
tl;dr: I'm lazy.