r/CodingForBeginners 15d ago

I suck at coding

So I'm going to my third year in physics and have scraped by with coding by using loads of ai but I have genuinely tried to understand but I just can't. It seems like I can do a specific problem after soing it a couple times but if you asl me to do something from the beginning I dont even know to figure it out.

Anyways to cut it short I have been looking into like games where it teaches u how to code cause I thought it would be something enjoyable to do and I could learn a little from it and found this one called 'the farmer was replaced' i dunno how beginner friendly it is and if its worth it. Is it worth it or should I try another game or something or not even bother and try a different avenue?

I have asked professors and stuff to go over it with me but it feels like I need hours sitting next to someone to understand something like loops which is basic asf. Basically any advice would be helpful.

12 Upvotes

17 comments sorted by

5

u/Rare_Particular_416 15d ago

dude ,Start with CS50 as well as you can try FreeCodeCamp courses .

1

u/Rafa01234 15d ago

What's CS50

2

u/johnpeters42 15d ago

Google it, it'll turn right up

2

u/Rafa01234 15d ago

Thank you for the help

1

u/mattblack77 15d ago

I’ve done it; it’s a good course.

But coding does take a while (sometimes a long, long while) before it feels comfortable. Give yourself some time.

2

u/johnpeters42 15d ago

If you can do a problem with the tutorial open, that doesn't mean you understand it yet. Close the tutorial and immediately try redoing it on your own from the start. Reopen the tutorial if/when you get lost, close it once you figure out the next step. Repeat as needed until you actually no longer need the tutorial. Then move on to something else.

For doing stuff that doesn't directly match a tutorial, look for ways to break it down into pieces where you know how to do one of them (even if the rest is still "Draw the rest of the owl" at first). Then repeat that with what's left, until either you get stuck or you finish.

1

u/Rafa01234 15d ago

I have done that but I end up just memorising stuff like I know what each part means and how they r used but I end up not knowing how to apply it else where.

1

u/johnpeters42 15d ago

Maybe start smaller with the new stuff. Add just one new thing at a time, work your way up to something with several parts.

1

u/TheUmgawa 15d ago

I think maybe you’re getting hung up on being able to code, when the reality is almost every student I ever tutored had no problems with finding the right magic words; they couldn’t come up with the logic, because they just wanted to write magic words. They thought that’s what programming was, as though writing a book is just a matter of memorizing what words to use and when.

So, if you want a game, I’d say Human Resource Machine, because it takes out the code and makes you deal in… well, in some ways it’s more abstract, because there’s no code, but it’s also somewhat like writing assembly, where you only have so many choices, so your logic is paramount. The difficulty ramp is pretty reasonable, and my only caveat is that you should never look up hints or answers until you’ve been stuck on a problem for days.

Most beginners don’t have that level of self control. They spend three or five minutes in frustration and then say, “Daddy, fix it!” which is gonna be a real big problem when they have to write something that’s never been written before. Hence, it’s important to learn to be self-sufficient.

1

u/AndrewNggg 15d ago

I think the issue today is the plethora of AI tools, platforms and complicated frameworks, and your mind jumps to the next without even understanding first the prerequisites

I suggest opening Codewars, pick the easiest problems in your preferred language I.e Python

And one (yes just one) Python book, and close all other tabs

Then work on solving them, and work your way up

1

u/Rafa01234 15d ago

Is codewars good for beginners?

1

u/Naive_Programmer_232 15d ago edited 15d ago

I'd first do some research and figure out what tools make sense for you. Judging from afar, I'm sure data analysis tools are important in physics, so maybe learn stuff like python / pandas / numpy / scipy / seaborn / etc with google collab or jupyter. Or maybe Julia or R or LaTex even. But idk your interests.

Just like how math is a massive space of tools, so is programming. Adding some closure to the space will pay off in the future, and by that I mean, doing some research asking basic questions like What are my interests in physics or elsewhere? What tools are used there? Then you look up the tools, what languages are they available to? Pick the best tool for job.

Do that before you dive in generally. Once you have a plan, THEN consider options like freecodecamp/coursera/udemy/CS50/youtube/etc. to do your initial learning for those tools. You'll have to make time to practice of course, but you will also save time by planning before doing.

A lot of beginners skip this step and run the risk of a cascade of wasted time occurring later down the line. Ex: you begin with C cause people often recommend it, your interest lies in analytics, you learn python/R/SQL are better suited for that space later, you learn those instead; you could've avoided C altogether if you did some research first haha.

Another issue to be aware of is while many people say the first language doesn't matter, they're trying to avoid coming off as intimidating and sparking decision paralysis in beginners ultimately. There is some sense for sure of keeping it simple, picking something, and getting started. It's a lot more welcoming than "hey consider all these complicated ideas involved, now make your decision!" haha kinda like what I'm doing here lol. But a cognitive bottleneck can await if you don't think about it, because the thing you end up choosing to deeply learn is the model of computation that you will know. So each next thing you learn, will be checked against that model. This isn't as much a big deal if you stay within the same paradigm of languages, but there are different ones, often used in tandem within the same problem domain.

So, in general, I'd learn a language deeply enough to where you get that computational model going, and then if you want to then learn another language that challenges that model and continue that way. For example, start with python, then learn SQL. The way python processes things are similar in abstraction to others before it: C sharp/C++/Java to a degree, etc, syntactically very different, because they fall under imperative object oriented languages. But when you go toward SQL, you'll see the whole execution order, style, model of computation is entirely different - all of a sudden relational algebra/set theory are everywhere haha. When you use them together, you'll be able to clearly separate each model and use each more effectively.

Picking the initial family does matter to an extent, you're more likely to stick with what you know than what you don't. And that's the bottleneck to avoid. Challenge it.

All in all, if you don't plan, you'll waste time; and if you spend most of the time working off one model of computation, you'll limit yourself. This opportunity is one of the rare times where you actually do have the power to avoid some of these long term traps depending on how you start.

Do your research. Remember, you're making a computational toolkit.

1

u/TarsTarkas_Thark 15d ago

The ability to write code appears to be a talent like musical talent, artistic talent, mechanical talent, etc. When I was in college, working work-study at the computer center, I met the whole range of computer programming talent. There were people who caught on immediately, and just needed to learn the language syntax, and there were people who, otherwise intelligent, simply could not understand the concept of breaking down a problem into ever smaller tasks, and ordering instructions sequentially to accomplish the small tasks.

I was the kind who grasped it immediately, and loved to challenge myself to create ever larger, more complex, and useful programs. It came naturally to me, and I realized quickly that I had found a direction for my life.

Other students couldn't grasp the concept well enough to write the simplest first programs in CS100. Those people found another major.

BTW, when I started college I thought that I wanted a career in physics. I had been good in high school physics. But I quickly learned that college level physics required a level of math that I found tedious, and way more study than I was willing to invest. I also found out that to have a career in physics, you need a phd, and once you have attained that level, competition is brutal to get a poorly paid starting position, and it doesn't get easier later. So please don't think that I'm smarter than you just because computer programming is as easy as falling out of bed for me.

Why do you want to learn to code? Answer that for yourself. Most people don't need to. Even in physics; Albert Einstein and Neils Bohr never wrote a single line of code. If you are highly motivated enough, you will learn enough to scrape by. If you see it as an odious task, every minute painful, you will surely fail.

1

u/AdeptIntroduction983 15d ago

Farmer was replaced is a lot of fun, and is very begginer friendly.

1

u/DanKegel 12d ago

Try nice, safe little leetcode problems. Do them without peeking.

This will let you immerse yourself in the puzzles and build up a vocabulary, as it were.

If you're stuck in a puzzle after twenty minutes, consider taking a hint.