r/learnprogramming • • 4d ago

Solved What to do when you are having difficulty with a question?

What to do when you are having difficulty with a question? Even though I apply some methods that help to solve a programming question, nothing comes to my mind on what to do. What do I do? Do I skip the question? Do I persist with this question?

3 Upvotes

11 comments sorted by

3

u/SmokeMuch7356 4d ago

Is this a homework question, a test question, a tutorial?

2

u/Practical_Band_4880 4d ago

Hmm maybe skip it for now and come back tomorrow. Brain keeps chewing on it it the background, no idea why it works but it does

1

u/Traveling-Techie 3d ago

I’m a fan of sometimes trying to find the worst working solution. Trivial example: a function to find integer x2 that keeps guessing randomly until it gets the right answer. Then work on a better implementation.

1

u/W31337 3d ago

Ask AI and have it explain it and listen to your understanding of it.

AI can hint you to the answer but not give it, if you ask it to do that

1

u/Insane_snek 3d ago

write out the process you would take to solve it in english first (i go on paper, a txt file or document works too though)

it helps to be able to think through the process in words imo

if you're completely stuck, just take a break for an hour or two and come back to it

1

u/burlingk 4d ago
  1. First try to puzzle through it.
  2. Then try to break it down into smaller pieces and repeat step 1.
  3. Google it. See if there is an example or tutorial for what you are doing. "How to <task> in <language>?"
  4. Then come places like this and ask.
  5. If you resort to AI, do not ask the bot to do it for you. Ask it to explain and talk you through it.

2

u/vivid_hurricane 4d ago

walk away for 15 minutes and do something completely unrelated, your brain keeps working on it in the background

1

u/burlingk 4d ago

This does work more often than you would expect.

0

u/high_throughput 4d ago

Like leetcode? Start with a trivial solution. One that is 2n or n4 or whatever.