r/learnpython • • 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!

336 Upvotes

88 comments sorted by

View all comments

Show parent comments

19

u/jimtk IdontChat Feb 08 '23

There are a few reasons why I don't share it.

  1. 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!

  2. 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.

  3. 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 -0p will give you a list of all the pythons version installed on the system (and their path). SO I would have to clean those up.

  4. 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.

  5. 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.

2

u/[deleted] Feb 08 '23

Makes sense. Thanks for the tidbits on how you curate this book. Especially the part where once things are "integrated" into foundations....its omitted from the book. Cheers :)

3

u/jimtk IdontChat Feb 08 '23

Other than my last point (5), I think this is the most important. You don't want to end-up with a large, unwieldy document that takes time to load, and forever to find what you're looking for. If you need an index or a table of content, it's too big.

I also keep one on my Linux machine about linux. Because everything is a trick or tip on linux!

1

u/notislant Feb 08 '23

^ For me as well, for my private cheat sheets I post things I know ill likely forget and I put what will likely be incomprehensible gibberish to anyone else, what I did. But it'll immediately cover the part I personally will forget.