Guides · Learning
Learn to code in twenty minutes a day
Pick one language for one thing you want to make, build something small before you feel ready, and let the pieces add up. You don’t need a free weekend. You need twenty minutes and a next step.
For you if you’ve never written code, or you’ve started a course or two and stopped, and you have about twenty minutes on most days.
The path · 10 parts
The hard part of learning to code is rarely the code. It’s the size of everything around it: which language, which course, which tools, how long it will take. Twenty minutes a day only works if each day has one clear thing to do.
This guide makes those choices small and in order. Each part ends on one small thing.
Pick one thing to make
Start with something you want to exist, not with “learn to code”. A page about your dog. A script that renames a folder of photos. A tip calculator. A page that tracks your runs. A real thing tells you what to learn next, and it tells you when you’re done.
Keep it small enough to finish in a few weeks of twenty-minute days. You can make the big thing later, out of the small things you learned here.
One small thing
Write one line about the first small thing you want to make.
Pick one language for that thing
Choose by what you want to make, not by what’s popular this year. Either of the first two below is a fine first language, and the second language you learn comes much faster than the first.
| You want to make | Start with | A free place to begin |
|---|---|---|
| Web pages and things in a browser | HTML and CSS, then JavaScript | MDN’s Learn web development1, or freeCodeCamp3 |
| Tools for your own computer, data, spreadsheets that got too big | Python | The official Python tutorial2 |
| An app for your phone | Learn one of the above first | Phone apps add a lot of setup. Come back to them in a few months. |
Pick one course and stay with it for a month. Switching courses feels like progress and isn’t: you redo the easy first chapters and skip the part where it gets real.
One small thing
Pick your language and your one course. Write both next to your one line.
Set up once, or not at all
Setup is where many people quit, before they’ve written a line. Courses that run in the browser let you skip it for the first few weeks3. When you do set up your own computer, give it one sitting, with the course’s own instructions open, and don’t try to set up everything you might ever need.
You need three things, and they’re all free: a code editor, the language itself (a browser already has JavaScript), and one folder where everything you make goes.
One small thing
Make a folder called “things I made”. Everything goes in there, with the date in its name.
A shape for twenty minutes
Twenty minutes goes fast. Give it a shape so none of it goes to deciding.
| Minutes | What you do |
|---|---|
| 2 | Read the note you left yourself last time. |
| 15 | Do that one thing: one exercise, one feature, one bug. |
| 3 | Write a note for next time: what works, what’s next, where you stopped. |
Stop in the middle of something, not at the end of it. If you know exactly what you’ll do next time, starting again takes seconds instead of a whole evening of deciding. A day you miss doesn’t undo anything. The code you wrote is still there.
One small thing
At the end of your next session, write one line for tomorrow before you close the laptop.
Build before you feel ready
Reading about code is not the same as writing it. Watching someone else code feels like learning and mostly isn’t. As soon as you know a little, make something tiny that’s yours, even if it’s half of what you planned.
It will be ugly. It will also teach you more than three more chapters would, because now you have to decide things the course decided for you. When you get stuck, you’ve found the next thing to learn.
Type code out instead of pasting it, even from the course. Your fingers learn the shapes, and you notice the parts you’d skim past.
One small thing
Change one thing in your last exercise so it does something the course didn’t ask for.
Get stuck on purpose
You will spend a lot of your time stuck. That’s the work, not a sign you’re bad at it. Most working programmers spend most of their day on things that don’t work yet.
When something breaks:
- Read the whole error, slowly. Most errors say what went wrong and on which line. The last line is often the most useful.
- Say what you expected, and what happened instead. Out loud, or in writing. Half the time, the gap is the answer.
- Change one thing at a time. Then run it again. Changing three things at once tells you nothing.
- Then search, or ask. Copy the error’s main line into a search. If you ask a person, say what you’re trying to do, what you expected, what happened, and what you tried4.
One small thing
Next time you hit an error, write what you expected and what happened before you search.
Learning with AI
AI tools can write code, and that makes them tricky to learn with. If one writes the part you’re trying to learn, you’ve learned to ask, not to code. Osiris is an AI too, so take this from one.
Use it to explain: what an error means, what a line does, why one way is better than another. Ask it to quiz you. Then write the code yourself. When you understand something well enough to explain it back, that’s when letting a tool write it saves you time instead of costing you the lesson.
AI tools can also be wrong, confidently. Run the code, and check anything that matters.
One small thing
Ask an AI to explain one line from your course that you only half understood. Then explain it back in your own words.
A first month, in pieces
| Week | Pieces |
|---|---|
| 1 | Your course’s first section. Make your folder. Save every exercise. |
| 2 | Keep going. Change each exercise a little so it does something of yours. |
| 3 | Start your small thing. Just the first screen, or the first step, working. |
| 4 | One more piece of your small thing each day. Show it to one person at the end of the week. |
At the end of the month, look in your folder. You’ll see how far you came. That folder is a better measure than any count of days.
Mistakes that cost the most
- Picking the “best” language for weeks.Pick by what you want to make, and start today.
- Switching courses.Finish one first section before you even look at another.
- Only watching videos.If your hands aren’t on the keyboard, it’s not practice yet.
- Pasting code you don’t understand.Type it, run it, change one thing, run it again.
- Waiting until you’re ready to build.You get ready by building.
Questions people ask
Do I need to be good at math?
For most programming, no. Making web pages, tools and apps uses little beyond arithmetic. Some fields, like games, graphics and data science, use more, and you can learn it when you get there.
Am I too old to start?
No. People start coding in their forties, fifties and later. What helps is the same at any age: a small thing to make, and a little time most days.
What computer do I need?
Almost any computer from the last several years will do for learning. To start, a browser is enough.
How long until I can get a job?
It depends on the job, the place and how much time you have, and anyone who gives you one number is guessing. Build things you can show. They answer that question better than any course certificate.
One small thing for today
Open the first page of one free course in the sources and do only its first exercise. Stop there.
Sources