r/learnprogramming • • Oct 30 '26

How to do better on my computer science class

I’m not majoring in Comp Sci. Taking the class as more a feeling out the major.

Recently got really cooked on the midterm. I’m using veteran benefits to pay for the class. So I can’t fail cause I’ll be put on probation and won’t be able to use them.

Many of my classmates have so much experience with programming. While I’m starting with zero.

Is there any resources that can help me or study habits?

8 Upvotes

16 comments sorted by

2

u/Upstairs_Jelly_1082 Oct 30 '26

Is your class more paper-based exam or actual coding?

1

u/PotetialMajorHistory Oct 31 '26

So the class has paper based exam and lab portion has us use vs code

1

u/Upstairs_Jelly_1082 Nov 01 '26

For paper based, I’d recommend going through the questions from past papers and figuring which topics are being used for each question. Then learning those.

7

u/BranchLatter4294 Oct 30 '26

Just practice.

1

u/YxngSsoul Oct 30 '26

Tech is a hands on field!

1

u/BranchLatter4294 Oct 30 '26

Exactly! Kids today think they can watch a TikTok video and be a programmer without practice.

7

u/BrannyBee Oct 30 '26 edited Oct 30 '26

Another Vet here, except Ive been in the industry for a bit now. Programming seems hard and like it requires a lot of math, but it's actually not. You should treat it like learning English or how to type, its about practice until it's automatic.

Don't think about keywords and syntax, solve the problem first, then translate the problem into keywords and the programming language. When presented with a problem, forget about conditionals, loops, functions, variables, etc etc and all that nerd shit. Just solve the problem with borderline schizophrenic short hand with a pen and paper. Then once you mentall solve the problem as if it were a real world problem and not magical code inside a computer, take your solved mental model and translate it bit by bit into whatever keywords and synrax the language you're using requires.

If you care to read, below is my kinda approach to solving problems. I used to do some tutoring for this kinda thing, mainly for other vets, so maybe the general approach helps. Or maybe it just seems like rambling.... take it or leave it... I feel its a useful approach and other muscle heads getting into CS found it useful

--->

Take a problem like this that could show up on a beginner test. Create a program that allows a user to input a word and will output how many vowels are in that word.

If your approach to solving this involves literally any Computer Science, THAT is why you are struggling. Me and many other dumbasses, many of us being borderline asvab waivers who can barely count, program for a living... and if you think the first thing we do when solving a problem is to think about any fancy sciencey terms, than you are giving us way too much credit. While you're reaching for your keyboard or your IDE to type some code, I am grabbing a white board (Im not kidding, I keep one in my desk and its one of the most useful tools I have for programming).

Instead thinking about any CS or programming concepts, just solve the problem first mentally. You cant handle anything yourself in this scenario, the worlds dumbest E3 was just promoted to Specialist, and your job is to communicate everything to them to solve the task at hand. Any dumb question they may have, they will have, anything they can fuck up, they will fuck up, so you need to communicate everything to them. The task is the program, the instructions to the E4 is the code.

You wouldnt just quick fire a bunch of commands at some brand new E4 and assume they'll do great delegating. You need to lay out every step of the problem in excruciating detail, or they'll fuck up. So on my white board Id literally write down everything i think Ill need to conplete the task.

Again, notice how much code Ive written. None, my IDE isnt even open at this point.

So taking this task, my list might look like:

  1. The program gets a word
  2. Program counts the vowels
  3. Program outputs the number of vowels

Thats a start. But now you need to go through every step and ask yourself "is this too conplicated for the worlds dumbest soldier to handle?"

Code, just like lower enlisted, handles one thing at a time. Anything more and it breaks ir breaks something else. If you ask an e4 to bring you a word, you have no idea where that little gremlin is gonna find a word for you or if it even will do it.

Everywhere in your list you notice that one "step" actually requires a few mini steps, you need to break it down into more steps. You dont want just any word from anywhere, the "test" question is specific.

So we have "1. The program gets a word"

If you gave the task to the dumbest soldier you've ever met, what are the dumbest questions they could possibly ask?

"Where do i get a word"

"Where do I put the word"

Then after brainstorming the dumbest questions possible, I erase my original steps and make a new steps that describe the task.

Now Id have something like;

  1. Ask the user to give me a word
  2. Store the word (somewhere????)
  3. Count the vowels
  4. Output the nunber of vowels

Progress, but notice theres still no code. Fuck the code, coding is literally the easiest part of programming, the mental model is the part you need to learn. Originally I thought this problem would take 3 steps, but step 1 actually doubled and requries 2 steps... if you started with the code and came to that realization, youd spend hours rewriting and deleting code to fix that. Solving the problem first without code forced you to catch that bug before it even happened and saved you hours.

Next, I would think its time to write some code, because I like writing code and Im good at it. But i wouldnt and would call myself an idiot for junping the gun. Fuck the code. You dont write ANYTHING until you have the mental model down. If you can look at the steps youve created to solve the problem and think of ANY dumb questions the worlds dumbest soldier might come up with, then you are moving on too quickly.

Id take that process, and my now 4 step program, and do it again. Id ask myself "whats the dumbest question I can see someone asking in my new step 1?" Same process as before, keep dumbing it down for your stupid specialist code. I know you've met a person or two while serving that might actually not understand what a "word" is.... I served, I know you have....

Well good job, you found another possible way for the task to get fucked up. You know that theres a chance that if you ask that SPC to go get a word from a user that they're gonna come back with a "7".... or a comma... or a picture....or a video.... or they're gonna come back with 10 words...... THATS how dumb we're talking.

When i look at the task of counting vowels in a word and displaying them, my mind imagines the dumbest person I ever served with and I imagine explaining to them how to do that. And the dumbest possible question I can see being asked is "what is a word", and I know that defining a word is necessary for my program.

Yadayada, Id keep doing that process over and over again til I have a reasonable list of steps covering every possible simple dumb thing required for the task, and still havent written any code. On my white board its just plain english, and maybe looks like this after i go through the same thought process over and over again for every step

1.) Tell SPC dumbass what a word is 2.) Tell SPC dumbass to get a word from a user and remember it 3.) If given something that isnt a word, yell at the person who gave him a non-word is 4.) Keep track of how many vowels we have 5.) Check the first letter of the word, if its a vowel oncrease the counter 6.) Check the second letter 7.) Check the..... 8.) Check the.... .... 100.) Output the counter

After all that.. its still not time to code....lol...

Now I would take every single step, and match them barney style to words the programming language uses. If i need to "store" something, i know its a variable. Anytime its storing something specific, thats the type of variable. A "word" obviously isnt a number/integer/boolean, its probably a string. So on the white board i make up some name for a string and write that down. If its a noun, its probably gonna be a variable

Anytime theres a verb, I know thats a function. Step 2 is asking the user for something, so chances are you're gonna use function, maybe input() idk. Where would the output of that function go though...? You already solved that, you're asking for a word, you recieved a word, its gonna go in that word string variable, and on my white board Id literally draw an arrow from the word input to that variable.

A counter is a number, probably an int. You see the word if written in plain english in those steps.... and that means you're probably gonna use an if statement, theres your conditional. And you notice that you have steps that repeat a bunch, checking everytime theres another letter. You can write out a million lines of code, or you remember that repeating like that means "i need a loop".

THEN you take that mental model and the solved problem you've written down and code it. You know what variables you need, you know where you need conditionals, you know where you need loops. You've done the hard part of actually coding, all that's left now is to translate ot into Python or Java or whatever you're using.

Like most beginners, if given a problem like that, you probably open up your ide and freeze or type some bullshit. More experienced programmers have solved the problem before they write the code, more likely than not, you're doing shit backwards.

Your classmates have experience programming so they're faster you say. Cool. The thing you dont realize is that the thing they're good at isnt remembering syntax at all. Thats the easy part at the end. The hard part is the thing that every new coder ignores... solve the problem, break it down and keep solving the problem. THEN all you have to do is learn how X language makes a loop or writes a variable.

You probably have a classmate that has programming experience in an entirely different coding language than the class uses. Yet, they are still better than you. Its because they arent "coding" right away. They're solving the problem, know they need variables, loops, whatevers... then they translate that "solve" into whatever language the class uses. They might not have a sibgle day more of experience than you in your Python(?) Course, maybe they have 10 years of C# experience. You both have a few weeks of Python experience, but you suck and they're awesome. Its because they're not doing Python for 99% of problems. They're thinking in the same way any language would have them solve the problem, the translating the already solved problem a the end.

3

u/ChaoticHippo Oct 30 '26

Some context on what class it is would be helpful. Generally speaking though, ask questions. Seriously - some things just won't click until they do, and there are some computer science concepts that are very challenging to understand at first. So even if it seems like a simple question or that other people aren't struggling with it, just ask a TA or go to office hours and ask.
So much of programming is knowing baseline information or concepts, and if those don't make sense to you it will be a struggle.

Outside of that, flash cards helped me a lot. I tended to make flash cards out of test prep guides when classes provided them. Otherwise, I would just compile my notes and then make flash cards as I went in the class (like every couple of weeks) for quick brush up study. Unless you're being tested on it, it's probably not worth your time studying things like code syntax or types etc. - better to focus on the concepts and data structures....that's where "what class is it" really comes into play.

2

u/aqua_regis Oct 30 '26

Is there any resources that can help me or study habits?

There are plenty resources, yet, you haven't said anything about what language(s) you are learning. Hence, no one can give you targeted advice other than Read the Frequently Asked Questions with their plenty recommended learning resources.

Also, check the subreddit. Posts like yours are more than plenty and common to all of them (and a symptom for your and the others' struggles) is that every single of them doesn't display the faintest effort in individually researching, but instead waiting to be served.

Read this - don't want to repeat myself.

1

u/QuadWingedCrane Oct 30 '26

Army vet here. Im at ASU for swe this semester with post911, then will be transferring to WGU with VRE.

I know how you feel. And yes, if this is your first experience with programming, and your current class is one of the Intro to Programming with Java or Cpp, youll be piled on with constant new information, and when you go to take the tests, they can be unforgiving bc an answer may look correct, but its actually wrong.

I took CS50 with Harvard before starting school. So I also had a little experience before enrolling in school. But when I first took CS50, I also greatly struggled to keep up.

Don't beat yourself up on the mid term.

You can still pass and understand it.

I got a 50 on my mid term, but just got a 75 on my third quarter.

1

u/AdDiligent1688 Oct 30 '26 edited Oct 30 '26

Was the midterm all coding or multiple choice or free response? It depends. Also what language? The coding side ultimately is practice, the people who are well versed probably didn’t learn it all in class, they built stuff outside of it and continually practice on their own time. Some also use AI to do it as well. I’d steer away from the latter in terms of copying, cause that’s cheating, but you can use it to help explain things to you and give you some quizzes to solve. Also don’t get intimidated, some of these wizard students are not actually wizards and only know basic stuff enough to feel this class is easy, but by next class they’ll be struggling 😂.

Maybe a good exercise could be take your homework / assignments / exams, if you have them, then give it to Ai and tell it to pluck from those and/or make up similar level challenges, then write it yourself to practice. Almost like automated flash cards that act as coding challenges. You could prompt the ai with quiz instructions in order to test your knowledge (ex: tell ai not to give you the answer and to mimic your teacher’s grading style in terms of strictness). There are also other sites like leetcode / hackerrank / codewars you could use to practice problem solving.

On the theory side, I’d probably just look at your notes and if the professor’s are available or lectures are recorded, try to get their pattern down, I’m sure there is one of how they emphasize important information. I’d also read the book if you think it has a lot of correlation to the multiple choice style questions you may have. Ime the tests can vary in the introductory courses, for me it was more of a mix of coding plus programming concepts (call stack / control flow / branching / journey to executable / etc) + computational theory e.g. basic data structures and algorithms (DSA) with some discrete math.

Again there’s wiggle room for you to figure out how to study for this class and actually learn some stuff. The ai cheating thing unfortunately is probably rampant wouldn’t be surprised if many of those wizards are doing that and then bragging about their knowledge. I was in cs pre ai and even there I saw it all the time, it wasn’t ai then, it was people hiring others to do the work for them or forming cheat groups or using test banks basically. It’s real. Yet another reason, don’t get intimidated by the wizards.

1

u/silver_chief2 Oct 30 '26

You have not told us anything about the class or how your grade is determined.

I could never learning programming by reading or watching. I had to have tasks to do, like tasks in structured classes. Maybe online or MOOCs.

You are responsible for educating yourself. The goal is to get more points on exams, quizzes, programs.

If you were the teacher and wanted to base a test on what you said in class, what questions would you ask?

I mean write your own questions to show you paid attention at the lecture or reading. Same thing for reading a chapter. Write your own test questions, maybe on 3x5 cards with the answer on the other side.

0

u/[deleted] Oct 31 '26

[removed] — view removed comment

1

u/PotetialMajorHistory Oct 31 '26

Appreciate the feedback. We are learning c++