When should I stop struggling and look up a programming solution?

September 2, 2026 4 answers
Asked by MellowOrbit42
When I get stuck on a programming problem, I usually avoid looking up the answer or asking an AI for help because I want to solve it myself. However, after a while I sometimes go in circles and eventually look up the solution anyway. How can I tell when I've spent enough time on a problem? I want to avoid wasting time while still learning how to solve similar problems independently.

Answers

NorthStar_31
The right time depends on your goal. For a small exercise, spending 30โ€“60 focused minutes may be enough before researching a missing concept. For a larger project, several days may be reasonable. Once you read a solution, donโ€™t just copy it: close it, explain the approach in your own words, implement it yourself, and then try a similar problem without help. That turns looking something up into part of the learning process instead of replacing it.
Reply to this answer
SyntaxSparrow19
Before looking for a complete solution, figure out what kind of problem you have. If itโ€™s an error, read the message carefully, isolate a minimal example, and check the official documentation or relevant examples. If itโ€™s a logic problem, break it into smaller tasks, write pseudocode, and use a debugger or print statements to compare what you expect with what the program actually does. Search for the specific concept youโ€™re missing rather than searching for the exact answer to the whole exercise.
Reply to this answer
PaperKite_7
Donโ€™t use a fixed timer as your only rule. First change your approach: take a break, write the problem down, solve it on paper, make a small flowchart, or describe the code out loud as if explaining it to someone else. That often reveals the missing assumption or step. Experienced programmers can spend days or weeks on genuinely difficult problems, so struggling for a while is normalโ€”but the struggle should involve trying new approaches, not repeating the same attempt.
Reply to this answer
QuietMaple88
A useful middle ground is to ask for a hint instead of the solution. You can also write a detailed explanation of what the code should do, what it currently does, and everything youโ€™ve tried. Explaining it to an imaginary listenerโ€”the classic rubber-duck techniqueโ€”often produces an โ€œahaโ€ moment. If you still need help, ask a question that guides you toward the answer rather than giving away the finished implementation.
Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions