Learn to program
52 videosA step-by-step path for complete beginners: how computers and the web work, then HTML, CSS, JavaScript, Go and a full-stack app of your own.
Start here: Inside a computer →Part 1 · How computers work
1:521Inside a computer
The CPU is the brain, the RAM is the desk and the disk is the filing cabinet: what each part does and how they work together.
2:182On and off: bits and bytes
A bit is one on/off switch, a byte is eight bits, and binary is counting with them. How ASCII turns letters and everything else into 0s and 1s.
1:383What an operating system does
The OS is the manager of the computer: it shares the CPU and RAM between apps, organises files on the disk and talks to your devices.
1:184Your first terminal commands
Talk to the computer by typing: pwd, ls, cd, cat and mkdir, and how to find your way around folders.
Part 2 · How the internet works
1:355Clients and servers
The client asks with a request, the server answers with a response. Like a customer and a kitchen, including what a 404 means.
1:296IP addresses and DNS
Every device has an IP address like a house number, websites have domain names, and DNS is the phone book that turns a name into a number.
1:337From a URL to a page
What happens when you type a URL and press Enter: DNS, a request, a response with HTML, CSS and JavaScript, and the browser building the page.
Part 3 · Think like a programmer
1:278What is a program?
A program is a list of exact instructions the computer follows in order. Algorithm, sequence and bug, explained with a robot that makes a sandwich.
1:079Events: when something happens
An event is something that happens, like a click or a key press, and an event handler is the script that runs when it does. Shown with Scratch blocks.
0:5810Loops: repeat instead of copy
A loop repeats blocks so you do not copy and paste them. Repeat, forever, and drawing shapes with a loop, shown with Scratch blocks.
1:0811Variables: a named box for a value
A variable holds a value under a name, and the value can change. Score, set and change, and what score = score + 1 means.
1:0112Conditions: if and else
A condition is a true or false question. If runs blocks when it is true, else runs when it is false. A fork in the road, with an umbrella or a hat.
1:1013Functions: name a group of blocks
A function is a named group of blocks you define once and call many times. Define, call and parameter, with a draw-a-square function.
1:1314Bugs and debugging
A bug is a mistake in a program. Debugging is finding it and fixing it: predict, run, compare, fix, shown on a square that does not close.
1:3815From Scratch to JavaScript
The same six ideas in blocks and in text: sequence, variable, condition, loop, function and event, plus what syntax and the console are.
Part 4 · HTML and CSS
1:2116What is HTML?
HTML describes the content of a web page with elements: an opening tag, content and a closing tag. The page skeleton, head and body, and nesting.
1:3517Links, images and lists
Attributes add information to a tag: href for links, src and alt for images. How a relative path finds a file, and how ul, ol and li make lists.
1:2218What is CSS?
CSS styles a web page. A rule is a selector, a property and a value, and a link tag joins the style.css file to the HTML page.
1:1319The box model
Every element is a box with four layers: content, padding, border and margin. How each one is set with CSS, and what changes when you change a number.
1:2220DevTools: inspect and fix
Right click and Inspect: the Elements tab, the Styles panel, live edits that vanish on refresh, and the Console for finding errors.
1:1621Classes and ids
A class is a name many elements can share, an id belongs to one element. The dot and hash selectors, and div and span as plain containers.
1:1622Flexbox
Line up elements with display: flex. Flex container and flex items, justify-content, align-items, gap, flex-wrap and flex-direction.
1:1823Responsive design
Make a page fit any screen: the viewport meta tag, flexible sizes with percentages and max-width, and a media query that stacks the cards on narrow screens.
Part 5 · JavaScript in the browser
1:2624What is Git?
Git remembers every saved version of a folder. Repository, commit, and the four first commands: git status, add, commit and log.
1:2425The DOM
The DOM is the tree of nodes the browser builds from your HTML. Find a node with document.querySelector and change it with textContent.
1:1926Events in the browser
An event is something that happens on the page. addEventListener waits for it and runs a handler function, shown next to the same idea in Scratch.
1:1827Changing the page
Toggle a class with classList so CSS restyles an element, and build new elements with createElement and append, like a to-do list adding tasks.
1:1528Arrays and objects
An array is a numbered list, an object is a set of labelled values. An array of objects and a loop turn data into cards.
1:2429Local storage and JSON
localStorage is the browser's notebook for your site. JSON.stringify turns an array or object into text to save, and JSON.parse turns it back.
1:2630Fetch and JSON
The browser is the client and fetch sends the request. The server answers with JSON, async and await wait for it, and the Network tab shows what happened.
1:1631Debugging JavaScript
Find bugs in JavaScript: console.log to look, reading an error message and its line, and a breakpoint to pause and step through code in DevTools.
Part 6 · Go basics
1:3832What is Go?
Go is a compiled language: the compiler turns main.go into a program and checks it before it runs. go run, go build, and the three parts of a first program.
1:2633Variables and types
In Go every variable has a fixed type: int, float64, string or bool. var and :=, why the compiler rejects the wrong type, and zero values.
1:1934If, for and switch
Decisions and loops in Go: if and else without brackets, the three shapes of for (counted, condition, forever), and switch, next to the same ideas in Scratch.
1:2035Slices and maps
A slice is a growing list of one type (append, len, range) and a map connects keys to values (delete, and the comma ok check).
1:1736Structs and methods
A struct groups named, typed fields into your own type, a method is a function that belongs to a type, and a pointer receiver changes the real value instead of a copy.
1:1637Errors in Go
A function that can fail returns an error as a second value. nil means success, and you check it with if err != nil, instead of an error jumping out like in JavaScript.
1:1838Testing in Go
A test is a small program that checks your code. _test.go files, Test functions, go test with PASS and FAIL, and table tests with many cases.
1:2139Packages and modules
A package is a folder of Go files, a module is the whole project (go mod init, go.mod), how import works, and why a capital letter makes a name visible.
Part 7 · Go backend
1:2340How a web server works
A web server waits on a port for requests and sends responses. Handlers, http.HandleFunc and ListenAndServe, and seeing the request in the browser.
1:3041Routes, methods and status codes
A route connects a path and a method to a handler. GET, POST and DELETE, the status codes 200, 201, 400, 404 and 500, and how Go answers 404.
1:1942A JSON API in Go
An API returns data instead of pages. A Go struct becomes JSON with struct tags, a handler writes it with json.NewEncoder, and the page loads it with fetch.
1:2143POST and saving data
A POST request carries data in its body. Decode the JSON into a struct, keep it in a slice (lost on restart), and protect the shared slice with a mutex.
1:1744What is a database?
A database keeps data in tables of rows and columns, like a strict spreadsheet. Primary keys, why data in a file survives a restart, and asking questions with SQL.
1:0145SQL basics
SQL is the language for asking a database: CREATE TABLE, INSERT INTO, SELECT with WHERE and ORDER BY, then UPDATE and DELETE (always with WHERE).
1:1446Go and databases
Go talks to a SQLite database with database/sql and a driver. Exec changes data, Query reads rows into structs, and ? placeholders pass values safely.
1:2047Input, validation and safety
Never trust a request: validate empty and too-long values and answer 400, why ? placeholders stop SQL injection, and keep secrets and database files out of Git.
Part 8 · Full-stack capstone
1:3348How the whole app fits together
A full stack app has a front end, a back end and a database. Follow one click from the page through fetch, the Go server and the database and back, with every term from the earlier lessons.
1:2549Planning a project
Plan before you code: user stories, wireframes on paper, a list of tables and endpoints, and small steps with a done-when for each.
1:1750Staying safe as a developer
Habits that keep you and others safe when you build apps: no secrets in code or Git, made-up test data, never trusting input, crediting other people's work and being kind.
1:2351Deploying an app
From localhost to the home network to the internet: what a server computer, a domain name, DNS and HTTPS do, and why public means more risk.
1:2052What to learn next
A map of next steps after the first year: front-end frameworks and TypeScript, more Go and databases, algorithms, games, security and open source, and how to keep learning safely.