Reading about a for loop takes a minute; writing one from an empty file without looking takes ten and teaches you more. The core techniques of programming — values, control flow, functions, collections, and reading errors — are learned by rebuilding them under small constraints, not by collecting explanations of them.
Rebuild instead of re-reading
Pick a program you can already explain, such as a script that renames files or totals a column of numbers. Close the tutorial and write it again from an empty file. Where you stall is precisely what you have not learned yet, and a stall is more informative than a page of notes you will never reopen.
Keep the old version in a second window and check it only after you have finished or given up. Comparing your attempt to the original shows the shape of your gaps far more clearly than reading the original a third time.
Five techniques underneath almost everything
- Storing and naming values, and knowing what type each one is.
- Branching and looping: deciding, and repeating.
- Functions with arguments and return values.
- Collections such as lists, maps, and sets, and when each is the wrong choice.
- Reading an error message until it names a line and a kind of problem.
When a problem feels impossible, the useful question is which of these five you are unsure about, not which framework to learn next. Most beginner projects are some combination of them.
Drill with constraints
Constraints turn repetition into skill. Take a function you have already written and rebuild it with a rule attached:
- No global variables — pass everything in and return everything out.
- No more than five lines.
- Must return a message rather than printing one.
- Must work correctly on an empty list.
The empty-list rule exposes the most assumptions, because it forces you to say what should happen when there is nothing to do.
Practice in short, frequent blocks
Twenty minutes a day beats a single long weekend session: you forget less between repetitions and the habit survives a busy week. Keep a folder of solved drills and reopen one after seven days. If you can rebuild it without help, it is yours; if not, you have found next week’s work.
How to tell you have actually learned a technique
Three tests, in increasing order of difficulty: explain it out loud in plain language, write it without a reference, and recognise the situation where it is the wrong tool. The third is what separates people who have memorised a pattern from people who can program.
Explaining it to someone else is the fastest check. The sentence you cannot finish is the part you do not understand.
Technique comes from repetition with attention. Choose one small program this week, rebuild it three times from scratch, and notice which line sends you back to the tutorial. That line is your next lesson, and it is more accurate than any course outline.