What to Do When You Are Stuck Learning to Code
There has never been more good material for learning to program and the failure rate has not improved, which tells you the bottleneck is not access to explanation. It is that watching someone else solve a problem feels exactly like learning and is not. Sixteen heuristics for the first year, mostly about what to do at the point where you are stuck.
Tauseef Fayyaz

The problem is not the material
There has never been more good material for learning to program, and the failure rate has not improved. That should tell you the bottleneck is not access to explanation. It is that most people learning alone spend their time in a mode that feels like learning and is not.
Watching someone else solve a problem produces a strong sensation of understanding. So does following a tutorial where every step is given. Both feel like progress, and neither builds the thing you actually need, which is the ability to face a blank file with a vague goal and not freeze.
What follows is sixteen heuristics for the first year. They are about what to do when you get stuck, not about which language to pick, because the answer to that one takes a sentence and the answer to the other takes a career.
Getting started at all
1. Choosing a language + three weeks of research → pick one and start today. Python or JavaScript, decide in an hour, never revisit it. The differences between reasonable first languages are trivial next to the difference between starting in January and starting in April.
2. A tutorial + a video player → type it out yourself. Not copy and paste. Typing forces you through every character, and the syntax errors you make along the way are the first real feedback you get. If you are watching more than you are typing, you are being entertained.
3. A finished tutorial + a feeling of confidence → build it again with the tutorial closed. This is the single highest value habit in this entire list, and it is brutal the first time. The gap between following and doing is where the actual learning is, and the only way to find it is to walk into it deliberately.
4. A project idea + anxiety about originality → clone something that already exists. A to do list, a weather page, a URL shortener. You are not trying to invent anything. You are trying to have a specification that somebody else already validated so you can spend your attention on building instead of deciding.
When you get stuck, and you will
5. An error message + a flash of panic → read the whole thing. All of it, slowly, including the file and the line number. Beginners bounce off error text because it looks hostile, and experienced developers read it because it usually contains the answer in plain language, roughly one time in three.
6. An error you have never seen + a search box → search the message, not your story. Paste the exact text in quotes, with the parts specific to you removed: your file paths, your variable names. Describing the situation in your own words finds very little, because whoever already solved this posted the error rather than the story around it.
7. Broken code + no idea why → print the values. Before frameworks, before debuggers, before searching. Put the value on the screen at three points and find out where reality stopped matching your mental model. Almost every bug is a place where you were confidently wrong about what a variable contained.
8. Stuck + forty minutes gone → make the problem smaller. Delete half the code, or rebuild the failing piece in a new empty file with nothing else around it. Most impossible bugs become obvious once they are alone, and the process of isolating one is most of debugging.
9. Stuck + ninety minutes gone → ask, and ask well. Say what you expected, what happened, and the three things you already tried. That format gets useful answers from strangers and, more importantly, solves the problem by itself often enough to be worth doing before you send anything.
Practising so it sticks
10. Copied code + it works → change one line and predict the result. Predict first, then run. Being wrong is the point, because a wrong prediction is the only reliable evidence that you did not understand it, and it arrives in seconds rather than in a job interview.
11. Practice + no feedback → get another human to read it. Working code and good code are different, and nothing in your own head will tell you which one you wrote. A community, a mentor, an open source pull request. Feedback is the ingredient that self taught learners most often skip and most obviously need.
12. A big project + week one → one working slice, end to end. Not the database schema for the whole thing. One thing a user can do, from the screen to storage and back, however ugly. A working slice can be extended forever; a beautiful half of a system does nothing and cannot be tested.
13. Working code + the urge to move on → make it clear, then move on. Ten minutes renaming things and splitting one long function. This is not about tidiness. It is the cheapest possible practice at the skill that most separates professionals from beginners, and you get to practise it on code you already understand.
Staying in it long enough to matter
14. A learning plan + weekends only → trade intensity for frequency. Forty five minutes a day beats a six hour Saturday, because programming is held in working memory and every day off is spent reloading context. Consistency is not a moral virtue here, it is a technical one.
15. Your progress + somebody else's → compare with yourself three months ago. You are watching other people's highlights against your own unedited footage. That comparison has never once made anyone better at this and it has stopped a great many people entirely.
16. Motivation + week three → replace it with a habit. The novelty runs out on schedule, always, for everyone. What carries people past it is a fixed time, a small next step decided the night before, and a low bar for what counts as a session. Motivation is what starts this; it is not what finishes it.
What else belongs on this list
Reading other people's code, which almost no beginner does and which is most of the job later. And building things you personally want to exist, because the project you actually use is the one you keep debugging on a Tuesday night when nobody is watching.
I would also add: keep a file of things that confused you and later stopped confusing you. On the days when it feels like nothing is happening, and there will be many, that file is the only honest record you have.
The short version
Pick a language in an hour. Type, do not watch. Rebuild without the tutorial. Read the whole error, then search it verbatim. Print the values. Shrink the problem at forty minutes and ask at ninety. Predict before you run. Get your code read by someone. Ship one thin slice. Show up daily, briefly.
None of this is about talent, and the people who make it through are not the ones who found it easy. They are the ones who were still opening the editor in week six, when it had stopped being fun and the thing still did not work.
Comments (0)
Comments are closed for now.
No comments yet.
Stuck on something specific?
Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Every session is free; a few slots open each week.
Follow along
New writing, resources and project ideas land here first.