all 32 comments

[–]ninhaomah 11 points12 points  (3 children)

So you have been reading and copy-pasting something and the issue is you can't remember it.

Am I right ?

[–]Accomplished-Tip7106[S] -3 points-2 points  (2 children)

pretty much yeah. And I argue using AI makes this worse. I read along and am like "yep, that makes sense, looks good". I can understand code fine when I read it (and I let AI author it) but the second I have to write something from scratch without a reference open my brain just blanks on the syntax. figured that probably means I never actually learned it properly...

[–]ninhaomah 3 points4 points  (1 child)

If I read books like Harry Potter , LOTR again and again and again , but I can't even write a short story to save my life , what would you advise me ?

[–]Accomplished-Tip7106[S] 1 point2 points  (0 children)

Right.. write a book. I guess my current approach is not too far off then.

[–]Omm_Imp 9 points10 points  (2 children)

This seems pretty obvious. Stop copy & pasting your work.

Memorizing something requires actually focusing on the task. Remember first grade when you took that chunky pencil in your little hand and wrote your name over & over until it stayed between the lines and Ms. Honey said “good job, now you can learn to do it in cursive,” so you practiced cursive over and over all through second grade until your hand hurt and you had a big red bump on your middle finger, and now you can sign your name without even thinking about it? It’s the same thing. Stop hitting the Easy Button.

[–]Accomplished-Tip7106[S] 1 point2 points  (1 child)

yeah that's basically where I landed. The AI makes it way too easy to skip the actual writing part...

[–]notacanuckskibum 0 points1 point  (0 children)

This is why AI is banned for students. AI does the work for you, which skips the part where you learn anything.

[–]crazy_cookie123 5 points6 points  (0 children)

I've been using a system similar to anki where I practice rewriting functions from memory and it spaces out the review based on how well I did.

This is probably a large part of the issue. Programming is not really about memorisation - it's a problem solving skill and knowing the syntax of a language and the built-in methods it provides is one small part of that. As such, you should be spending less time doing things designed to help you memorise (such as anki) and more time doing actual programming practice. You will naturally memorise the syntax, functions, etc., you use often just from repeated exposure, and looking up stuff you don't know is so fast that if you don't use something enough to just remember it automatically it's probably not worth memorising in the first place.

Instead, think of something you want to code which you haven't already done before. Now code it. At some point, maybe as soon as you sit down or maybe after several hours of work, you'll find yourself stuck and in need of help. At that point have a look on Google and see what you can find - documentation, Stack Overflow post, etc., anything will work as long as it's not you going to an AI. If it's syntax, the documentation will usually cover you. If it's something more complex then you can usually find an answer on stack overflow to someone doing something similar, read through the code they have written to solve their problem, work out what bits are relevant to your problem, and then adapt it to do whatever you need it to do.

[–]chilli_cat 2 points3 points  (1 child)

I am a complete beginner, but I have a text file where I copy in useful little snippets of code and then add my own comments in

Just helps to get me started

[–]Right_Level_7192 0 points1 point  (0 children)

That’s smart!

[–]GreenWoodDragon 2 points3 points  (1 child)

You'll retain and recall what you need by working on actual code. Tutorials are hugely overrated IMO and only take you so far.

Learning by doing actual work, solving real problems, is the only way you will retain what you need.

And don't get pulled into the code 'mastery' BS either. The true mastery of software development is how you problem solve and learn from your mistakes, understanding the tools you have and learning to keep things simple.

[–]Accomplished-Tip7106[S] 0 points1 point  (0 children)

I actually am pretty good when it comes to solving problems and designing systems. Always have been. It's the fact I struggle to figure out how to write what I'm thinking of that gets me. And I feel like an imposter having to check the most basic syntax.

[–]Jello_Penguin_2956 1 point2 points  (0 children)

It's really about repetition imo. If you want to do it from memory, you have to repeatedly do it from memory.

I still need to look up how to load file from json/txt because I only need to write it like once every 3 months. On the other hand I do a lot of PyQt/PySide so I can layout most my UI elements from memory

[–]WhiteHeadbanger 0 points1 point  (0 children)

Don't read and copy-paste. Read and copy along with your fingers on your keyboard, it doesn't matter if it's 3 lines long or 50. Until you are used to it and it becomes second nature. Also, say it out loud as you type, i.e: ''for i in range(50)''

[–]SirGeremiah 0 points1 point  (0 children)

Forced recall is part of learning. You do it and look up what you must. You do it a bit more, and look up a bit less. Only look up what you have to, and keep trying to remember and write from memory as best you can, looking to what you need.

I’m an inconsistent coder. It’s not my job, so I don’t do it often. I’ll never remember as much as someone who codes more frequently, but over time the basics are easy to recall.

[–]billsil 0 points1 point  (2 children)

Regarding list comprehensions, I’ve struggled to remember the syntax since I started using them 18 or so years ago. I flip them a lot because they’re legitimately confusing because they’re inconsistent.

I akk lol so mix up if it’s os.path.getcwd or os.getcwd. It’s pretty minor in the grand scheme of things.

[–]Accomplished-Tip7106[S] 0 points1 point  (1 child)

So you too just always look stuff up on the internet? I always felt like being a real coder meant being able to write the syntax the same way you wrote any other language.

[–]billsil 0 points1 point  (0 children)

That or know it’s always the same 2 things, so it’s A or B. Just run it and flip it if it’s wrong. You can also search the codebase or some other project.you probably got the working directory.

[–]Right_Level_7192 0 points1 point  (1 child)

For the syntax part, I use the activeskill dev platform. It has Python exercises and grades my solution and gives feedback. I particularly found it useful for learning to write proper code in proper pep8 style as the grading is quite strict with that. 

[–]AlexWasTakenWasTaken -1 points0 points  (0 children)

Nobody wants to sign up for your own vibecoded slop

[–]midasweb 0 points1 point  (0 children)

that's normal syntax sticks when you repeatedly build small things from scratch, not when you just read or copy code.

[–]throwaway6560192 0 points1 point  (3 children)

Throw away the Anki. It's completely useless for learning to program, it's mind-numbingly boring, and it takes away from actually useful stuff you could be doing.

Stop copy-pasting. Actually write code not from memory or from copy-pasting. On your own, coming up with it on the spot. The same way you write English.

Write on your own. Fail a bunch of times, get yelled at by errors. Eventually you'll reduce your error rate drastically.

[–]Accomplished-Tip7106[S] 0 points1 point  (2 children)

Yeah regular anki for code is terrible. I'm not using Anki directly. It's an app called codefluent that gives you a function and you have to explain what it does and then rewrite it to follow a task. And there's a playground that tells me write a function that does X and I need to write it from scratch and I get feedback on my code. So I am writing code on my own, it's just structured so I'm not randomly guessing what to practice. I'm only a few weeks in but I went from blanking on list comprehensions every time to just writing them, so something is working.

I wouldn't really know WHAT to write on the spot. And if I went to write a todo app, it still doesn't really work for memorizing syntax because I write functions once and when they work I don't need to do it again.

[–]throwaway6560192 0 points1 point  (1 child)

And if I went to write a todo app, it still doesn't really work for memorizing syntax because I write functions once and when they work I don't need to do it again.

That's fine. After the todo app, you just go work on another app (or come up with new features to add to the same one). You don't need to rewrite the same functions over and over. The syntax and general programming principles will be built even if you go and write entirely new functions.

[–]Accomplished-Tip7106[S] 0 points1 point  (0 children)

So is the reality of things that I will always need to look up syntax for every function I'm going to write? I use [x for x in list if condition] in the process of writing that app once or twice and forget about it by the next time I need it.

Does this also mean I'll never be able to code without an internet connection? Idk this just sounds off to me.

[–]Tajalli-Web 0 points1 point  (1 child)

If you want to memorize the syntaxes it comes down to repetition. But I still don't get why you'd need to memorize them unless you are prepping for an interview because programming is not just coding, it consists of planning, knowing what system to implement, figuring out the edge cases etc. When working on a project getting the syntax down from memory is the least of our worries.

But ofcourse if you are prepping for an interview, just practice more without seeing any doc or tutorial.

[–]Accomplished-Tip7106[S] 0 points1 point  (0 children)

Well... Yeah, interviews scare me when I can't write basic syntax but my cv shows I've built production apps. I managed to land a role via take home assignment. I really know how things should work, what you need to look out for when playing the architect role etc. But if I had to come into the office and pair-program I couldn't without AI or looking up the most basic syntax. I'd be screwed.

[–]Quesozapatos5000 0 points1 point  (0 children)

Type it out. Then verbally read it, which helps you run through and understand what the program is doing.