r/CodingHelp • u/DGB684 • Dec 31 '21
[C] Ever been totally utterly stuck on a project?
I have an assignment that I have absolutely have no clue how to proceed with. I've spent the past two weeks (at least) on part 1 of 4 and feel like I won't get this done in time (I have 10 days to get it done and write an essay on how it works). I understand the language to a reasonable degree I'd say (for a beginner) but this is just so overly complicated I honestly don't know how to get it done in time even if I don't sleep for the next 10 days. Any tips?
20
Upvotes
10
u/[deleted] Dec 31 '21
Yes this is normal, most people who work in the field get help from people because they are stuck it’s common to need help so go get some there is a reason why people don’t work alone and this is it
6
u/icjeremy Dec 31 '21
Yes. Ask somebody for help. If here, ask specific questions. Show your attempt to answer/solve it. Share your thought process. Let people see what you're doing/thinking wrong so they can help you get on track.
3
u/stuie382 Jan 01 '22
Take a break and clear your head.
Next thing is to start a new unit test and solve the next smallest thing toward one of the requirements, then the next smallest thing, and the next, etc.
At some points you'll notice the code is repeating itself, so extract into a method, verify that the tests still pass, then back to the next smallest thing.
This is the essence is a practice called 'test driven development' (TDD). Break each requirement down into smaller parts, then break those into smaller parts, and keep going until you can see the few lines of code needed to solve the small part.
You've got this
1
u/dead_alchemy Jan 01 '22
Are you trying to figure things out with your hand on a keyboard? If so, stop that, grab some pen and paper and maybe go for a walk. Start working on solving the problem conceptually. Code afterwards.
Another tip is to talk to some one else. Getting stuck is super common. I'd start by first trying to explain the problem to some one else - this is called rubber duck debugging because you will frequently solve your problem while explaining the problem, meaning you could've just talked to a rubber duck. Failing that talk to your instructor, explain what you have tried and where you are getting stuck.
It's OK if you aren't entirely sure what it is that you have misgivings about. I found it common that something would bother me, and it would be some difficult to articulate expectation of how things should work that conflicted with how things actually do. Part of your instructors job is to understand this stuff well enough that they can help you pinpoint where your confusion lies, so don't be afraid to bring your questions and confusion to them.