Concepts
One idea per page: a short explanation, a picture of what happens, code to run and a tiny practice.
/
Python
- DictionariesA dictionary maps keys to values, like item names to counts or usernames to scores. Look up, add, update and loop over pairs.DonePremium
- Catching errors with try and exceptSome errors are going to happen, like a typo in a number. try and except let your program handle them and keep running instead of crashing.DonePremium
- Functions and return valuesA function is a named block you can run with different inputs. Parameters carry values in, return carries one value back out.DonePremium
- Lists and positionsA Python list keeps values in order. Read items by position, count from the end with negative indexes, take slices and change the list in place.Done
- Loops that build a resultA for loop runs the same lines once for each item. Pair it with a total or a new list that grows on every pass to turn many values into one answer.Done
- Names and valuesA Python variable is a name that points at a value. Two names can point at the same value, and that matters once the value can change.Done
- Strings and textStrings hold text. Index and slice them like lists, tidy them with methods, and build messages with f-strings. Methods never change the original.Done
Web
- ArraysAn array keeps values in order. Read them by index from 0, add with push, count with length and walk through them with for...of.Done
- Promises, async and awaitSome work finishes later. setTimeout, promises and async/await let your code wait for a timer or a server without freezing the page.DonePremium
- The DOM and eventsFind elements with querySelector, react to clicks and typing with addEventListener, and change what the page shows with textContent.DonePremium
- Functions, parameters and returnA function is a named recipe. Parameters are its inputs, return hands back the answer, and arrow functions are the short way to write one.DonePremium
- Values and typesEvery JavaScript value has a type. typeof tells you which, and the type decides whether + adds two numbers or glues two strings together.Done
- let, const and block scopeWhen to use let and when to use const, what reassigning means, and why a variable made inside curly braces vanishes after them.Done
- The box modelEvery element is a box of content, padding, border and margin. box-sizing decides whether width means the content or the whole box.Done
SQL
- Aggregates, GROUP BY and HAVINGCOUNT, SUM, AVG, MIN and MAX squash rows into one number. GROUP BY gives one row per group, and HAVING filters the groups after WHERE has filtered the rows.Done
- JOIN: two tables into one resultA JOIN pairs rows from two tables wherever a column matches. INNER keeps only the pairs; LEFT keeps every row of the first table.Done
- NULL, the missing valueNULL means "unknown", not zero or empty. Why = NULL never matches, how IS NULL and COALESCE work, and what NULL does to COUNT and AVG.Done
- SELECT, columns and aliasesSELECT picks which columns come back from a table, can work out new ones from them, and AS gives any column the name you want.Done
- SubqueriesA subquery is a SELECT inside another query. Use one as a single value, as a list for IN, or as a table in FROM, and know when it runs once per row.DonePremium
- Filtering rows with WHEREWHERE keeps only the rows that pass a test. Combine tests with AND and OR, and match patterns, lists and ranges with LIKE, IN and BETWEEN.Done
- Window functionsWindow functions add a ranking, a running total or a group total to every row without squashing the rows, using OVER, PARTITION BY and ORDER BY.DonePremium
C
- Arrays in memoryA C array is a row of same-sized values packed side by side in memory. Indexes start at 0, and nothing stops you walking off the end.Done
- Compiling a C programC source is text. A compiler turns it into a program the machine runs, and if it cannot, nothing runs at all. Learn the two kinds of error.Done
- Pointers and addressesEvery variable lives at an address. A pointer is a variable that holds one, and * follows it to the value that lives there.Done
- The stack and the heapLocal variables live on the stack and vanish when their function returns. malloc gives you heap memory that stays until you free it.DonePremium
- Strings are char arraysA C string is an array of chars that ends with a 0 byte. See why strlen and sizeof disagree, and why the array needs one extra box.DonePremium
- Structs, dots and arrowsA struct groups related values into one type. Read fields with a dot, and through a pointer with ->, so functions can change the real thing.DonePremium
- Types and sizesEvery C value has a type that fixes its size in bytes. See int, char and double, measure them with sizeof, and watch an int overflow.Done