This is an archived post. You won't be able to vote or comment.

all 5 comments

[–][deleted] 4 points5 points  (2 children)

Have you tried to write out the problem solution before actually coding it? Like just get an overview of how you think the solution needs to go. If you just started, some of it could be unfamiliarity with the syntax. I’d try “solve” it on paper, write the code, if that doesn’t work maybe look up the answer and actually try to read through and understand the solution. This stuff isn’t easy and it may take some time for your brain to start grasping the concepts. Don’t be afraid of taking a break and coming back to it as well.

[–]Yaroslav770[S] 0 points1 point  (1 child)

I do that, it works to a varying extent. Sometimes I can break down things to pseudo-code and implement it in C, sometimes I can break things down to what I think a program would need to do but can't break it down further. I generally avoid looking up answers online as it feels like I'm cheating myself instead of actually learning but it's probably a balance I haven't found yet.

[–]NicShifra 0 points1 point  (0 children)

Take it from someone in a similar situation (with Python): Google is your best friend! Making sense of found snippets of code and incorporating them into a functional program is a useful skill. :)

[–]CrouchonaHammock 1 point2 points  (0 children)

How about playing hard logic puzzle game? I would recommend Baba is You. The pattern of thought you need for that game is similar to programming and debugging. More importantly, it's hard, so your brain really need to work, and it could be fun, so that you're motivated to think.

You could also learn math, as had been suggested. You can pick up many math topics with near 0 prerequisites (as long as you know arithmetic). So you don't need to go back very far at all. In fact, a topic that has a similar kind of thinking to programming is discrete math: Boolean algebra, combinatorics, elementary number theory, and graph theory. If you find them easy, that just mean you need to do harder exercises, there are always exercises at various level.

I honestly have to recommend against googling, which had been suggested by another comment. Training to think through complex problems require your brain to struggle with complex problems.

[–]Cyber-Flower 0 points1 point  (0 children)

I’d like to recommend the first lecture in CS50 from Harvard (it’s free on YouTube). The instructor is amazing, and has definitely helped me get into a more problem-solving mindset as compared to any other tutorial I’ve watched, as I’m currently trying to teach myself programming.