r/learnpython • • May 30 '20

Python cheat sheet?

I was wondering whether you guys keep a handy cheat sheet when y'all code. For example when working with a module after a long time it's obvious that we become rusty and need help with the functions and the syntax. Would be great if you guys share the links/books that you guys refer to while programming. I'm sorry if this has been asked before. Cheers!

372 Upvotes

50 comments sorted by

View all comments

-15

u/cas4d May 30 '20

Needn’t and shouldn’t. For basic commands, you should pick up a project and write enough lines of codes so that you can remember them, looking at cheatsheets can make it harder to memorize; for packages, use documentations; for others, use google and stack overflow, should cover 99.9 percents of your problems.

0

u/[deleted] May 30 '20

[deleted]

4

u/cas4d May 31 '20

I believe most would agree more with you just by looking at the upvotes, I was actually believing i was making constructive opinions after articulation, but any way. And maybe you are right for some learners.

But I am still taking the chance to supplement a point in case: cheat sheet, for some and maybe not for all, can reduce the time of processing it in one’s mind simply because of functional and mechanical nature - you have a vague idea about what you want, and you know something lying in your reference could sort of achieve it and you look up.

But I would argue this is a great time to dive in what you really want in a particular context; why use A not B even if they spill out the same output; is performance an issue; can we make it friendly for future debug, etc. When you consider all aspects, you would realize to achieve sth you can potentially have hundreds of ways with different purposes in nature. Cheat sheet simply doesn’t tell you these, and reinforce a narrow perspective and limit you from trying different things, “I want to have output y from input x, there is one line in my cheat sheet does exactly that”. Any learner is expected to write thousands of shitty codes before good ones come, and shit codes by definition is still working codes, but just inappropriate. And have yourself fixated in the beginning makes it slower or even impossible to be a good coder.

The ultimate message of my school is that: it is ok to have a painfully slow beginning, keep forgetting so that you are exposed to opportunities of going up to StackOverFlow and read those discussion regarding a syntax question, and possibly learn an alternative way to achieve sth. The real enemy is really not being mindful enough when writing codes.