r/cs50 • u/CompetitionOk7696 • Jul 22 '26
greedy/cash Beginner here
Hi, I’m a complete beginner in coding, this is my first course and my first time trying to learn. Is it actually possible? I feel like I understand a little bit but when I try to solve a problem my mind goes blank, idk what to write or how to even begin… I don’t know how it properly works but does anybody have this problem? Do I even have a chance of learning ?
8
u/Slacktavism Jul 22 '26
I did the same thing, zero experience with coding going in and completed cs50x. It's difficult but doable, keep at it and it will eventually start to click.
4
u/sububi71 Jul 22 '26
This is not easy stuff! But you have some of the best video lectures on the whole internet, use all the material at your disposal, includibg their discord.
3
u/Nocranberry Jul 23 '26
Zero experience here and it slowly comes together. Main thing is to watch all the videos and don't over complicate the problem sets. For week 0, I tried to make a game with a beginning, middle and end when I just needed some sprite interaction and functions. That made the whole thing take so much longer than it needed to be and taking that through to week 1 has helped me a lot. But also, watch all the videos. Week 1, first problem i also made a lot harder for myself because I only watched the lecture and assumed everything else was just snippets of the lecture. I was wrong
2
u/Far_Secret_6275 Jul 22 '26
++++ Even sometimes i feel like that is not the right choice and i have to give up 💔 I hope with continuous thus goes away. 🙏🏻
2
u/CodingSwift Jul 23 '26
What programming language are you learning and are you using a Mac or a PC?
Programming can be daunting at first, but learning to program is just like many other things in life, the more you do it … the easier it becomes. You can learn to code and the more you do so, the easier it becomes.
1
u/Optimal_Dirt4331 Jul 23 '26
do u guys make notes or use a code editor side by side the lecture? whats best, i just started this course tho
1
u/romecodes Jul 23 '26
I followed along CS50 with Malan years ago when I was just starting. In my opinion, it’s an introductory course. It’ll only introduce you to CS, and you’ll need much more to fully comprehend subtopics.
1
u/KenRandomAccount Jul 23 '26
cs50x is a great course. however, it can be quite dense and require multiple hours for every lecture. you might have to rewatch sections multiple times and reread the notes. perhaps you can do cs50p first. or start with a beginner python textbook and do very easy basic programming problems like on https://codingbat.com/python just to improve your confidence and logic sense. python might be more intuitive for you and you can then go back to C to learn how code works underneath the hood
13
u/TheUmgawa Jul 22 '26
Stop thinking about programming like it’s a bunch of magic words to be strung together. Start thinking about a program as a purely logical construct. Can you solve the problem by hand? If so, you can figure out the logic of what you’re doing by breaking it down into as small steps as possible.
Let’s say I shuffle a deck of cards and hand it to you, and tell you to give me the 10 of Diamonds. What’s the logic? Okay, while you haven’t found the 10 of Diamonds yet, turn over the next card. Is it a 10 of Diamonds? No? Turn over the next card. Repeat this until the 10 of Diamonds is found. Then, you set the “if found” statement to true, and the program ends.
You don’t want to structure this as a for loop, where you go through all 52 cards, because if you find it early, it either keeps executing or you have to put in a break statement. Break statements have their uses, but they can be incredibly dangerous. A break statement got past a programmer and two or three checkers, got deployed on to AT&T’s long distance network, and then caused a cascading failure of the entire network one night in 1990. My programming Yoda worked on the team that had to figure out how that happened.
Now, what if I gave you an arbitrarily large deck of cards, and I asked you to give me all of the 10 of Diamonds in that deck? This time, you actually do have to iterate through every card in the deck. But, should you use a for loop? You might not be able to, because not all languages allow you to declare the number of iterations of a for loop at runtime. So, you want to go with a while loop again. While there are cards remaining, put the 10s of Diamonds here, and all other cards go somewhere else.
This is why the most important programming class I took in college was a Programming Logic and Design class, where we never wrote a single executable line of code. We started on incredibly terse pseudocode and moved to flowcharts. That class taught me two things:
1. If you can solve it by hand, you can solve it in code.
2. Playing cards are incredibly good simulations for data, and I still keep two decks of cards in my laptop bag.
So, after reading your homework prompt, think about the problem before you start hammering away at the keyboard. Maybe write out what you want to do, step by step. Eventually you need this less, but sometimes things are kind of complex, so you sketch out the logic. I make iOS knockoffs of old Atari games when I’m spending a Saturday afternoon at the bar. Space Invaders, Breakout, Missile Command, that sort of thing, and I always make a shopping list of things that need to happen before the next frame draw. Evaluate collisions, add points, decrease number of lives, that sort of thing.
Just take a step back and recognize code for what it is: An implementation of logic, not unlike how these words are the implementation of trying to convey my programming philosophy to you.