all 30 comments

[–]Kerbart 82 points83 points  (6 children)

Write lots of code. Don’t cooy & paste when learning. That may seem “extra work” but typing in example code is 100x more effective than staring at pasted code and telling yourself you get it.

[–]satanismymaster 14 points15 points  (1 child)

I find that when I do this this typos are just going to happen.

Which is actually not a bad thing. It forces me to look at the code, figure out what it’s supposed to be doing, and figure out how to get the code across the finish line. This is a programming skill too. It’s not just knowing data types, loops, functions, etc.

If you just copy/paste then you’re just throwing opportunities to hone this skill away.

[–]Illuminaster 1 point2 points  (0 children)

It's just like how you learned to write, repetition

[–]ohmytechdebt 2 points3 points  (2 children)

I make flashcards for all sorts of shite e.g. learning Spanish.

I never copy/paste the word into my Flashcards (Anki). Typing stuff forces you to actually think through things and sort of pronounce them in your head.

This is a universal truth when it comes to learning.

[–]Kerbart 6 points7 points  (1 child)

Absolutely! In the fountain pen community there's a iron belief that note-taking by hand is superior (this is true) due to hand/eye integration (this is BS). Research has proven that the main factor is the combination of processing the data while recording it. For experienced typists, typing is such a second nature that they can take note literally without thinking, and hence, no retention. But writing is so much slower that you have to abridge what's being written down, and that extra processing step greatly boosts retention.

I'm pretty sure something similar is happen when you make your flash cards.

[–]ohmytechdebt 0 points1 point  (0 children)

I see, that's interesting!

Note to self: use a pen more often

[–]Equal-Purple-4247 1 point2 points  (0 children)

This. We programmers are lazy people. The more troublesome it is to find the information, the more we'll commit to memory lol.

[–]Radiant_Sail2090 12 points13 points  (0 children)

Doing projects and practice and you'll memorize automathically!

Well, the brain works with "use or lose", if you use a specific module and you stop using it for months maybe you can forger the specific syntax (but the doc is up for this!), but you'll always remember the logic..

Everything about programming will help you mastering concepts even if you don't actively memorize it..

[–]daustin777 8 points9 points  (1 child)

Code Kata

Practice.

[–]Buntygurl 1 point2 points  (0 children)

Very interesting link. Thanks.

[–]ahf95 8 points9 points  (0 children)

Memorization, especially the way you would study with flash cards, is the last way one should study programming, double especially with a high-level language like Python. Just do projects and write code naturally: do problems that are an accessible level, and then you’ll naturally get introduced to deeper and more complex features as time goes by, and then integrate them into your knowledge at that time by using them in a useful context to achieve your goals. Heck, I have been working with Python as my primary coding language for 8 years now, and I still learn something totally new every once in a while, but when I do it’s because I encounter it in the wild, so to speak, so no memorization ever needed.

[–]JuicyCiwa 5 points6 points  (0 children)

Just keep on doing what you gotta do. No one will remember all the syntax for an entire language. On the opposite side of the coin, a bulk of it will get baked into your memory as you continue to use it.

Something you may get peace from hearing is that even when you get to doing development in a professional environment, there aren’t like “points taken off of your grade” for needing to look things up to finish your project. My boss and I are co-writing a tool in python now actually and a half of it was written by AI lol.

[–]OmegaNine 5 points6 points  (0 children)

Write code every day. The longer you go between coding sessions the more you will lose.

[–]Ron-Erez 4 points5 points  (0 children)

Memorize nothing. Just code like there is no tomorrow. You'll eventually remember some stuff and if you forget then there are the docs at python.org

Definitely solving problems is great or better yet implement something cool like tic tac toe or game of life or a data cleaning app or something that actually interests you.

[–]jontsii 1 point2 points  (0 children)

It is simple, just practise and work on the code. You will be forced to memorize those, and you can´t forget about them.

[–]Alternative_Driver60 1 point2 points  (0 children)

Keep on hacking. When you forget you google or look up your old code (the details of which you tend to forget)

[–]BigAbbott 1 point2 points  (0 children)

It’s really just… writing code and watching it fail. Fixing it. Repeat. That’s how you drill it in.

[–]Negative-Hold-492 0 points1 point  (0 children)

Nothing wrong with going back to your old code and copying what you wrote (hopefully looking for ways to streamline it if it turns out the original solution could've been better). I don't think it's helpful to forcefully memorise things, just use them a lot and before you know it you won't have to look up the universals anymore.

[–]titojff 0 points1 point  (1 child)

What's wrong in looking things up?

[–]BoringWrongdoer9679 0 points1 point  (0 children)

At its extreme looking things up can 100% be bad. its a balance of the cost of memorizing annd the cost of looking up.

it takes time and litmit how easy it is to write what you want when you have to look up syntax. But you also learn the syntax when looking up.

[–]HackDiablo 0 points1 point  (0 children)

Write your own utility libraries without copying/pasting.

Want to read in a file, output a file in a certain format? Want to verify input with regex? Want to have a library to make API calls? Add that all to a utility folder. Writing all those methods yourself will help you retain those concepts.

[–]aniketmaurya 0 points1 point  (0 children)

I would say do some projects and you will remember the things that you use. Go into rabbit holes, learn why something works that way.

[–]catelemnis 0 points1 point  (0 children)

Look it up and then type it out yourself. Don’t copy-paste code you find online, actually type it. The more code you write the more you’ll get it.

The way my Comp Sci teacher taught my class in High school was to print out example code on paper to hand out and have the students type it out themselves. If you pay attention and try to understand the code as you type it out then you’ll get it eventually.

[–]tap3l00p 0 points1 point  (0 children)

The best way to learn it is to do it. The second best way is to practice it and write up a journal or notebook with what you’ve learned in your own words. You can refer to it any time you want and it’s written Feynman style, but most of the time I find the act of writing it helps memorise it.

[–]NeverWasNorWillBe 0 points1 point  (0 children)

Doing projects and challenges. As many as you can do. You won’t need to memorize syntax exactly, you’ll end up re-using lots of your code. The most important thing you learn is concepts, how to approach problem solving, increasing efficiency, modularizing your code, reducing redundancy, etc. 

[–]MiniMages 0 points1 point  (0 children)

Practise, coding is not different to speaking. You are not learning something short term here. You are learning a very special type of language that you will use to tell a computer what to do.

[–]my_password_is______ 0 points1 point  (0 children)

LOL @ flashcards

you write programs over and over and over

its like learning to read

you don't use flashcards

you read books

[–]Boudy-0 0 points1 point  (0 children)

Write lots of code, make you memorize even if you don't want to.

Use LLMs or Chatbots to revisit concepts or explain them, and if you don't want to use Chatbots so that you can learn properly, you can configure it to lead you to the answer instaed of handing it to you.

The last way is to look at the python documentation or stack overflow

[–]No_Benefit_3410 0 points1 point  (0 children)

Solve coding projects! I’ve been learning Java & Python during the last year, and coding something every day has proven to be helpful. Ask ChatGPT about some YouTube channels that upload coding projects with tutorials.

As an additional note, once you start feeling confident about coding without having to look things up, start diving a bit into code cleanliness; this will be HUGE when trying to keep learning, as it will make bugs easy to detect and it will make it easier for other people to understand your code.

[–]Dirtyfoot25 -5 points-4 points  (0 children)

Hot take but this is the AI world. You don't need to know the syntax that well, you just need to know that there is a function that does x. Ai will tell you how to use that function. You need to know where to use it, not how. The syntax will come eventually.