Writing code and reading it are different skills, and AI has made the second one considerably more important than it used to be. Most of what a beginner now runs was written by something else, which means comprehension is the bottleneck rather than composition.
What is the wrong way to read a script?
Top to bottom, line by line, first time. That works for prose and not for code, because the first twenty lines are usually setup that only makes sense once you know what the script is for.
What order works?
- Read the whole thing quickly without trying to understand it, to see its shape.
- Find where it starts doing the actual work, which is often near the bottom.
- Identify the inputs and the outputs: what goes in, what comes out.
- Follow one path through, ignoring error handling and edge cases.
- Then go back for the details.
What questions make it tractable?
- What does this produce? The output is the anchor for everything else.
- Where does the data come from? Files, input, network, hard-coded values.
- What is the main loop doing? Most scripts have one thing they repeat.
- What could make this stop? Which reveals the assumptions.
How do you use AI to help without skipping the work?
Ask for structure rather than explanation. A summary of what each section does, without line-level detail, gives you the map and leaves the reading to you.
Do not explain this line by line. Tell me in five bullet points what this script does overall, what it reads, what it writes, and which section does the main work. I will read the details myself.
What do you do with the part you cannot follow?
Isolate it. Ask what a specific line does, in the context of the lines around it, rather than asking about the whole script again. Precise questions get precise answers, and it keeps the rest of the reading yours.
How do you check your reading was right?
Predict before running. Say what you expect the output to be, then run it. A wrong prediction is the most useful thing that can happen, because it locates exactly where your understanding diverges from the code.
What about code with no comments?
Normal, and worth adding your own as you read. Writing a note above each section in your own words is the reading equivalent of explaining it back, and it leaves the script comprehensible when you return to it in three months.
Why does this matter more than it used to?
Because the alternative is a growing collection of scripts nobody can maintain. Code that works and is not understood is a liability that compounds: the second script builds on the first, and by the fifth nobody can change anything without breaking something.
How long should reading a script take?
Longer than writing it, which surprises people. A fifty-line script generated in ten seconds takes ten or fifteen minutes to read properly, and that ratio is normal rather than a sign of slowness.
The temptation is to skip it because the code appears to work, and that is exactly the trade being made: ten minutes now against an unknown amount of time later when something breaks and nobody understands the file. Treating the reading as part of the task rather than as optional overhead is what keeps that from accumulating.
What is the standard to aim for?
Being able to change it. Understanding is not a feeling, it is the ability to make a deliberate modification and predict what will happen. If you can add a feature or change a behaviour without guessing, you have read it properly.