r/learnprogramming • • Oct 09 '26

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?

2 Upvotes

11 comments sorted by

3

u/SmokeMuch7356 Oct 09 '26

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

2

u/Practical_Band_4880 Oct 09 '26

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 Oct 10 '26

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 Oct 10 '26

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 Oct 10 '26

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 Oct 09 '26
  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/[deleted] Oct 09 '26

[removed] — view removed comment

1

u/burlingk Oct 09 '26

This does work more often than you would expect.

0

u/high_throughput Oct 09 '26

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