r/AskProgrammers • • 12h ago

Python

I need to be able to code with python for my a-level comp sci exams in 2028 that I just started but i'm finding it honestly pretty difficult.

Anyone got any tips for being more profficient/ learning better.

And just any tips to be able to code better at all.

2 Upvotes

12 comments sorted by

View all comments

2

u/BrannyBee 11h ago

The answer isn't fun to hear, but its literally just practice. Build lots of things, then build those same things again but better, then do it again. Then build things you've already built before, but slightly more complicated and incorporating new stuff, whether it be patterns you've learned or entirely new concepts.

You learned Hello World. You can read Hello World. That diesnt mean you should move on to the next thing, it means you now have that in your backpocket as something to keep practicing. After mastering Hello World, play with it, break it, see what it does. You can make your Hello World app print something new but just logically understanding that stuff in the quotes gets printed. You arent able to build just one thing after learning Hello World. You learned Hello Friend, Goodbye World, [insert anything here], etc etc. What happens if you type out the code for hello world 3 times? Try it and see, stuff like that refines the basics.

Then when you learn conditionals and user input, you might make a basic text advanture game in class. Thats a good project and you should build it a bunch of times. But also go back to Hello World, ask the user to enter their name, and instead of Hello World, build Hello [users name]

Then you learn loops. You go back and make the text advanture game with a basic gsme loop this time. But you also go back and build Hello World again, but this time you use loops for a feature. Same thing for variables, make it without hardcoding a string, stuff like that.

The fact of the matter is, is that coding is actually really easy. But its easy in the same way typing without looking at the keyboard is easy.... you probably dont even think about it, but when you first learned how to do it, it might have been uncomfortable to keep your hands on the keyboard home row, and pressing certain keys with certain fingers might have felt like a waste of time learning how to do.

More experienced devs read code and write it, and to you it seems like theyre all geniuses. That would be like if someone watched you type at 100wpm and thought you were a genius for being able to do it. You arent. And Im a fucking idiot and can read/write code a lot better than you. Its just repetition everyday for a long time til its automatic. Do it slow at first, and look up the answers when you need to, but you gotta keep doing it over and over again til you stop needing to look up the answers as often. Then its just like typing out a comment on reddit.

The real annoying part is you gotta force yourself to "go to the gym" and do it a lot, which makes it seem harder than learning to type without looking at the keyboard... but what you have to recognize, is that every bit of time you spend writing essays in school, talking to people on discord or playing video games, or just wasting time online is time you're unintentionally practicing touch typing.

So maybe you had a class in school where you spent a semester learning how to type properly. Withiut realizing it though, you practiced that skill every single day outside of class, you didnt just spend a single class period learning that skill. You don't code on discord when you talk to your friends or make reddit comments, you type... the big difference is you need to get as much practice as you can the same way you learned how to type, while recognizing how much you truly "practiced" learning to type outside of class, and force yourself to practice

Eventually though, coding stops taking up brain power abd program becomes all about puzzle solving and building stuff. Because all your brain power is spent on on that stuff, and the actual writing and reading code is easy and automatic. Then practicing programming becomes a lot kore fun, because the practice doesnt feel like homework anymore, just like how playing a video game doesnt feel like practicing touch typing

1

u/SweetConsul 7h ago

Grab some past papers and code the questions cold the next day so the mistakes show exactly where to focus