Is it normal to understand code when reading it but completely freeze when writing it yourself?
Posted by liamkeats@reddit | learnprogramming | View on Reddit | 78 comments
I’m learning web dev and I’ve noticed a weird gap.
When I read code, follow a tutorial, or look at an example, I can usually understand what each part is doing. But when I try to build something without looking, I freeze and suddenly don’t know what file to start in, what function to write first, or how to break the problem down.
It doesn’t feel like I understand nothing, but it also doesn’t feel like I can actually build independently yet.
Is this just a normal stage of learning programming? What helped you get past the “I can understand it but can’t create it” phase?
aleques-itj@reddit
You have discovered that you can't just read your way to being an expert - you need to write more code and do things yourself.
ilovefamilyguy69@reddit
I've never understood this advice, yet I see it all the time. What is a person supposed to do to be able to write more code, when they are struggling to write code in the first place? That's like someone telling you they can't read, and then responding "you just need to read more."
exapunk_11@reddit
Can you learn how to solve polynomial equations by watching your professor solving it on the whiteboard? How do you even prove that you can solve them if you never actually solve?
ilovefamilyguy69@reddit
I went to tutoring and had someone walk through it with me and then I learned math. I didn’t just try writing stuff until it magically appeared in my brain.
MutaitoSensei@reddit
I don't know why you're getting downvoted, this is a legit problem people have.
ilovefamilyguy69@reddit
because it’s Reddit and particularly in this field people want to feel superior, despite this being a community for learning. I don’t know why asking for help yields so much aggression from people
dawalballs@reddit
You didn’t ask for help tho? You were just pretty openly wrong about basic advice, and you didn’t even manage to be nice while doing it.
davenirline@reddit
Like write more code by yourself? It is a problem with a very obvious solution.
LWdkw@reddit
How did you learn to swim? How do you learn to ride a bike? How did you learn handwriting?
Surely not by just watching others until one day you stood up and said: today is the day I can swim.
ilovefamilyguy69@reddit
I learned those things by being taught by someone and walked through how to do it while guided. Not given a bike and told to keep practicing until it works.
grantrules@reddit
How do you get better at a piano? Do you just sit down and read a bunch of sheet music? Or do you play twinkle twinkle little star over and over again until your brain hurts? Like yeah I can read the sheet music to Contradance in G Major but I sure as fuck can't play it.
Temporary_Pie2733@reddit
I’ve never touched a piano in my life. I read Bach’s The Well-tempered Clavier cover-to-cover 20 times, and have first concert tomorrow night. Wish me luck!
redditor000121238@reddit
Coding is still possible. No shot at piano dude. Using your fingers are in itself a skill.
mxldevs@reddit
They need to go back to the hello world and do the exercises themselves instead of just looking at solutions and pretending they can code because they "understand what it's doing"
theo__r@reddit
I mean, that's what learning is
Mortomes@reddit
Exactly. The problem with just reading code and understanding it is that you are just reading the final product. You're not seeing the process that led to it. The coming up with an idea you want to implement, breaking it up into parts, writing and testing the parts, rewriting things as you gain more insight into the problem, testing and debugging your code, etc. All of that is invisible to you. Struggling through these things is how you learn.
ExtraTNT@reddit
Brother, this is how you learn things…
balefrost@reddit
Isn't this exactly how children learn to read? They start with simple books, they slowly sound out the words, and they build skill. They start to recognize familiar words faster. They gain a larger vocabulary, and they learn to guess at the meaning of words from context.
They do, in fact, just read more.
Own-Student7991@reddit
Omg AI ate your brain. <3
You think about what you want to build, you write down a plan / organization or code, then you go build it starting with a simple version that has the various parts first. Review your work, make adjustments you feel make sense, repeat.
Also, yes, it's normal to be anxious about building larger projects. Even after ten years I feel that way about backend microservices. I've used and improved them at a bunch of jobs but 95% of my work was adding features to and revising frontends.
BubbleProphylaxis@reddit
think of it this way.
Level 1: You learn how to talk. You understand language. but you cant read or write.
Level 2: You learn how to read. You understand language better but you can't necessarily write.
Level 3: You learn how to write. You understand language even better, but you dont necessarily have a large vocabulary and/or you write with a lot of mistakes.
Level 4: You learn to write well. You understand language even better, but you aren't necessarily a novel writer.
Level 5: You write for a living. You're a top writer.
So how do you think you learn how to code? It's not called a programming language for nothing.
Limited_Distractions@reddit
You don't learn to read or write without attempting to read or write. They are applied knowledge skills that require you to do them to improve. Writing especially is the application of the knowledge of reading; syntax, alphabet, vocabulary etc.
101Alexander@reddit
Yeah, its also very common to be able to start reading a language before being able to write or metaphorically speak it.
AUTeach@reddit
You fuff about, experiment, think about it, try the wrong thing, think about it some more, read the tutorial/instructions again, think about it some more, try again, get almost get it right, iterate until you get it right.
That's how everybody learns everything.
aleques-itj@reddit
Get stuck, Google, figure out the problem (without blindly copy/pasting shit), repeat
You now know more than when you started
That's basically it
boblibam@reddit
You do it like you learn anything else. You start with super simple tasks and crank up the difficulty over time.
Similarly, you probably look up a lot more in the beginning. But you should practice in a way that lets you use fewer and fewer guard rails. Practice and repeat.
RadicalDwntwnUrbnite@reddit
Funny enough you can learn to read that way, it's incredibly inefficient but possible.
But what OP is saying is more like they understand how sentences and stories work but don't know how to start writing a book or write an outline. Start with writing a story, it's gonna be shit and you're gonna struggle but you don't have to write a best seller and struggling is an important process in gaining experience.
The problem with classes, tutorials and articles/videos on programming is that they almost never show the instructor/author trying something, it not working and them researching similar solutions in documentation, forums/SO and asking others for tips, and honestly that's some of the most valuable part of learning to write code.
Anhar001@reddit
No
Express-Channel-1686@reddit
completely normal. reading is recognition, writing is recall. way harder. fastest fix that worked for me: stop reading first, just sit and try to write something dumb from scratch. when you get stuck, then look it up. you build the recall muscle that way.
florinandrei@reddit
I, too, feel like I could beat Hafthor Bjornsson when I fantasize about it.
But if I go and try to actually do it, I completely freeze.
Flat_Adeptness_9240@reddit
I remember my first big project. I was sitting at my desk with a printed-out sketch of a website I had dreamt up, and I thought, "Piece of cake." Flash forward two hours — and I’m still staring blankly at a blinking cursor, my brain refusing to translate the plan into code. Then I recalled something my mentor, Dave, told me: "Break it like Lego. Start with building one tiny piece." So I did just that, focused on the header, got it working, and the rest started to click. Realizing that it's all about tackling one small challenge at a time was my lightbulb moment in programming.
JGhostThing@reddit
If you can't use your knowledge, you do not really understand it. You may need to learn in a different way. For example, I can only learn from reading, videos, or teachers, if I take notes. I discovered this far too late.
Sometimes people learn best with rubber duck debugging. In other words, rephrase what you've learned so that you can explain it to a rubber duck or young child.
But you do you. Whatever way works for you. Remember that what works for others may not work for you.
Another thing you can do is appropriate projects. This should be something that fits a problem from one of your other hobbies. For example, one of the things I try is a book database. I start with an SQL database and a simple server that communicates with a GUI client.
I like this project because I've done it so often that I already have the SQL schema in my mind. This project covers a lot of different types of programming.
This is important to me, because I read, a lot.
iOSCaleb@reddit
Have you ever read a novel?
Have you ever tried to write a novel?
Being able to follow code that someone else has written doesn’t mean that you know how to write the code yourself. Understanding (or feeling like you understand) a piece of code is not the same as understanding why the author wrote the code the way they did.
Innovator-X@reddit
This is an outstanding analogy.
quietcodelife@reddit
the blank file problem is its own skill separate from understanding code. when youre reading a tutorial the structure is already handed to you - you can see where things live and how they connect. building from scratch means making all those structural decisions before you know enough to make them well. what helped me was just accepting that the first structure is probably wrong, building it anyway, and fixing it later. you figure out the right shape by building the wrong one first. the freezing usually breaks once you give yourself permission to start badly.
Nanooc523@reddit
I can read a novel and enjoy it but not sure how to author my own book. So yes , it’s normal.
RealNamek@reddit
I have the opposite problem
mxldevs@reddit
You have found out that coming up with your own solution is completely different from just reading someone else's solution.
Programming isn't about just learning how to read code, you also need to write code by spending hours doing the exercises, which forces you to figure out how to apply the concepts you learn to implement a solution.
Many people skip the exercises and just look at the solutions and go "uh huh, I get it"
When I learned programming, I did all the exercises.
I was one of the slowest students, still stuck on the first few chapters because I was spending all my time doing silly exercises. But I was always able to write my own solutions because that's how I learned to code.
mxldevs@reddit
You have found out that coming up with your own solution is completely different from just reading someone else's solution.
YellowBeaverFever@reddit
It is part of the learning process. Just like any other second language, you learn to read it first. That’s just pattern recognition and memorization. Creating something new requires many more parts of the brain to be up to speed. Even if you knew every word in the programming book, you still need to practice putting the pieces together.. over and over again. Failure is a requirement. Without failure and frustration, you deny your neurons the reward when you figure something out.
Crexis_@reddit
hmm, this used to be worrying, but nowadays you don't need to handwrite code yourself anymore.
Get an AI agent to do it for you, then read and validate what it creates.
haddock420@reddit
I'm the opposite. I can write code for pretty much everything I need to do, but when I read other people's code, they use functions and methods that I'm not familiar with and I end up being confused to how it works.
CuriousCaseOfPascal@reddit
Reading and really having to understand (crappy) code written by others without any documention is a whole lot different from reading code examples from a tutorial
OldWalnut@reddit
You need practice my friend, try an interactive site like jsexercises.com and practice until the syntax is burned into your soul
Witty-Afternoon-2427@reddit
That’s completely normal because reading is passive but building forces you to make decisions and that skill only comes with practice
Backtawen@reddit
completely normal, its called the tutorial trap. understanding but not being able to produce. what helped me was just closing everything and trying to build something broken. doesnt matter if it doesnt work, the struggle of figuring out where to even start is exactly the muscle you need to train
Witty-Afternoon-2427@reddit
That gap is real, understanding is recognition but building needs recall and practice which only comes after struggling through it repeatedly
Biliunas@reddit
A good test to see if you're fooling yourself or not about fully understanding something is trying to teach or explain the concept to someone else. Chances are, you can't!
andrewb233@reddit
Well there is no thing like writing code to get better this is number 1, but with that said we live in a new world of amazing opportunities to obtain knowledge rapidly using AI.
In your particular case i would definitely leverage AI here and ask about very specific code blocks you dont understand and ask ai maybe to draw a flow chart diagram of where the code starts and all the diff places it goes (depending on how big the project is this might not be the best if so just have a flow chart for the use case you want to follow).
Honestly what ive learned through teaching many many people coding is that they are there biggest blocker, people get intimidated by not understanding a word like maybe void or manifest etc.. then think wow look at the complex word this is just too hard for me. In the end these are usually just a needed word that even good programmers dont remember fully and just copy and paste from stack overflow (pre ai days haha)
Number one thing is dont get intimidated just research and i guarantee you will come to find a lot is not hard and you can read a lot more than you think. Your in a very good route by learning the foundations then reading code to see how much you understood.
Dont get scared keep coding and researching and soon when reading code you will instintively understand what is fluff syntax and what is real code. You will really know its working and your doing correct things once you go to code from a language you dont know but still can read it and say exactly what the code will do. Good luck!
syklemil@reddit
That's like the most common type of post in this subreddit, followed closely by people who mistake it for a career advice subreddit
kupinggepeng@reddit
Psuedo-code is your answer
inuskii@reddit
It’s like when you learn a new language. You first start understanding and reading but speaking needs more practice
r_hayess@reddit
Understanding code is a passive skill; writing it is an active one. You’re freezing because you're trying to build the whole house at once. Break it down until the next step is so small it’s impossible to fail. Don't know where to start? Just create an empty index.html. Then a single
ExtraTNT@reddit
Test driven development is a good thing to learn -> ask a llm to build you tests to practice coding -> then implement the functions
nero_djin@reddit
Yes this is very normal. To get the producing patterns you need to produce.
There are also other cases; behold fibbonacci numbers.
and
finally something like
gm310509@reddit
I think you are missing an important middle step which is to take what you just read or saw, recreate it and then try to tweak it to do something else. And what I mean by that is to hit pause constantly and try out each little increment. Not watch/read the whole thing and then try to do it.
To use an analogy, you can sit and watch a movie, but that won't make you a movie director or producer. It is the same here, just because you can read/watch a tutorial or example, doesn't mean you can create it on your own. That takes practice.
The-Oldest-Dream1@reddit
Yepp
aqua_regis@reddit
It is normal to read and understand a book but to be unable to write a meaningful, comprehensive, fully developed one?
That's the exact same question.
Reading and understanding, and writing are two completely different skills that both need to be trained and practiced individually.
You need to write code, you need to program in order to improve your programming skills.
The FAQ have plenty project ideas and practice sites.
Moldat@reddit
Is it normal to watch Eminem spit bars but freeze up when trying to deliver them yourself?
rustyseapants@reddit
I am guessing you made it through high school right?
You studied various courses, did reports, learned new vocabulary, passed tests, right?
You're a learning something new, it doesn't happen over night.
Material-Sherbet6855@reddit
Its very normal.
Best way to fix it is to write more code.
Simple, easy code first. But you gotta type it yourself. None of that copy/paste bullshit. Write it yourself. Over and over and over.
The more you write yourself, the easier the next one will be.
Limited_Distractions@reddit
I think this is a pretty typical experience but I would emphasize that "gap" is in actuality the bulk of human experience. Your educational experiences have probably overemphasized the importance of the knowledge in this equation, when applying it is often the real challenge.
You have the things you know and the things you can do; what you need to do is build a bridge between them and that means using both a lot more. This often means that instead of worrying about the blank slate giving you pause, you should focus on learning the pieces of the bridge you need to build, because any of those could be the cornerstone to the first thing you really do make.
PositiveParking4391@reddit
yes! but start practicing bro reading only isn't enough
romii_13@reddit
Repetition creates habit that is the foundation for learning and success. ~I just came up with that on the spot lol
AUTeach@reddit
The order of learning (code):
babypho@reddit
Normal. Its kinda like reading vs writing.
Comprehensive_Mud803@reddit
That’s not normal, you’re lacking practice.
GreatMinds1234@reddit
Normal crazy Been there myself.
plugiva@reddit
As per my experience it is quite normal. But the difference is "you know it and you don't want to ignore it". AI creates perception that you don't need to bother. But the reality is you must bother.
What helped me is to continue push myself without assuring my sub conscious mind that AI will save me however. Try other human sources, find books, use forums that already has a solution, and never forget to code yourself.
One thing that helps a lot: don't try to build the whole thing in your head.
Start with something almost trivial, like: - create the file - print something - hardcode a value - then slowly replace it with real logic
This will make you aligned with AI in less time. You will be able to take highest role (architect, security specialist, manager).
That's how we evolve. If ignored, a full AI dependency will be dominated which is not a good thing. Hope this helps.
Illustrious-Cat8222@reddit
This is not unusual in the beginning.
Don't try to solve a project all at once. Pick a piece, anywhere, and work on that. Repeat. Rework as needed.
The more experience you get, the less rework you'll need.
AFlyingGideon@reddit
In fact, that's how any nontrivial software is written. Break the problem down into smaller problems, choose one, repeat until there's a small problem that can be solved. Then the next, the next, etc., combining the simple solutions into increasingly complex solutions until the problem is solved.
This approach to problem solving - divide and conquer - is useful well beyond software engineering. However, be warned that not every decomposition will work. Sometimes, one ends up in a dead end and backtracking is needed.
This will also look very familiar when learning algorithms. Software engineering involves remarkably few techniques that we reuse over and over and over... including the technique of reuse.
hibikir_40k@reddit
A common technique is pseudocode what you need to do at the highest of levels, and then decompose each step until it's small enough you can write it. For you right now this might mean a lot of steps: For someone that has been practiced long enough, it's not.
Just learning to break the problems down opens up everything else. It'll help tell the AI what to do too, as a typical problem is that it breaks the problems down "wrong".
dvisorxtra@reddit
This is the answer, that's why they teach you pseudocode and logic first, then programming.
ninhaomah@reddit
I also can watch chefs cooking and understand why they do what they do but when it comes to boiling an egg , I freeze.
How hot is "boiling" water ? Do I use thermometer? Laser ? Or put my hand in the pot to measure ?
Challenging!!!!
Gnaxe@reddit
Usually it's the opposite. I can understand the code I've written myself, but legacy code can be really hard.
BranchLatter4294@reddit
It's common if you don't practice.
Pyromancer777@reddit
They are different skillsets and you gotta practice both regularly.
If you spend time writing a bunch of code, you may struggle to understand the structures that others use.
If you spend time reading a bunch of code, you never build the foundations of solving the problems yourself.
johnpeters42@reddit
Start with something small enough that you do know how to build on your own, then try to go a little bigger. Look stuff up as you need to. Repeat the process and try to expand the "know how to build on your own" part.
As for where to start and how to break things down: just guess, and be prepared to revise if needed. Depending on the situation, you may be more comfortable writing the top level and working down from there, or writing the bottom-most pieces that you expect to need and then work up toward connecting them together, or maybe a combination and meet in the middle.
phantom_metallic@reddit
This is called "tutorial hell."
You think you understand what's going on while reading/watching a tutorial but, when it comes time to build something on your own, you realize that you don't really understand anything.