Notes / Series
Programming Fundamentals, From Scratch
A learning series that goes from how a computer runs code to building real systems, and ends with why these basics matter more, not less, now that AI writes code too.
25 of 25 parts published
- Start hereThe basics of the basics: what programming is made of
Strip away languages and frameworks and programming rests on a few ideas: building blocks, three ways to control flow, abstraction, and a loop of solving, testing, and practicing.
- 01What happens when you run a program
From a text file to instructions a CPU can run: memory, the fetch-decode-execute loop, and what compilers, interpreters, bytecode, and JIT actually do.
- 02Bits, bytes, and data types
Everything in memory is just bits. Data types decide what those bits mean, and why 0.1 + 0.2 isn't 0.3, an int8 can wrap to -128, and an emoji can be 4 bytes long.
- 03Memory: values and references
Why changing one variable sometimes changes another. Values vs references, shallow vs deep copies, garbage collection, and the Python default-argument trap, with real output.
- 04Variables, state, and scope
Where a variable can be seen, how long it lives, and who is allowed to change it. Scope in Python, JavaScript, and Go, closures, and why shared state causes so many bugs.
- 05Conditions and boolean logic
True, false, and everything in between: truthy and falsy values, short-circuit evaluation, == vs ===, || vs ??, De Morgan's laws, and how to keep if statements readable.
- 06Loops and recursion
Two ways to repeat work: loops that walk through data, and functions that call themselves. for, while, break, off-by-one errors, base cases, stack limits, and memoization, with real output.
- 07Functions: input, output, side effects
What goes into a function, what comes out, and what else it changes along the way. Parameters, return values, how arguments are passed in Python, JavaScript, PHP, and Go, and why pure functions are easier to trust.
- 08Basic data structures
Lists, maps, sets, stacks, and queues: what each one is good at, how they look in Python, JavaScript, PHP, and Go, and why picking the right one can make code tens of thousands of times faster.
- 09Breaking a problem down
How to go from a vague request to working code: understand the problem, list examples and edge cases, split it into small functions, build and test each piece, then put them together. One worked example, start to finish.
- 10Algorithms and Big-O without the heavy math
Why some code gets slow as data grows and some doesn't. What an algorithm is, how Big-O describes growth, the handful of classes you'll actually meet, and real timings that show the difference.
- 11Abstraction and naming
Abstraction hides details so you can think about one thing at a time; names are how you point at what's hidden. What a good abstraction looks like, how names carry meaning, the conventions in Python, JavaScript, Go and PHP, and what happens when an abstraction leaks.
- 12Reading other people's code
Most of the code you'll work with was written by someone else, often someone who isn't around to ask. How to get oriented, follow one path instead of reading everything, find things fast, ask git why a line exists, and pin down behavior before you change it.
- 13Error handling: fail clearly
Things will go wrong: bad input, missing files, a server that doesn't answer. The question is whether your program says so clearly or quietly carries on with wrong data. Silent failures, useful error messages, exceptions vs error values, where to catch, and failing fast, in Python, PHP, Go and JavaScript.
- 14Testing basics
A test is a small program that checks another program. What a good unit test looks like, which cases to pick, how a failing test points at the bug, regression tests, the test pyramid, and the same idea in pytest, Go, Node's test runner, and PHPUnit.
- 15Debugging systematically
Debugging is not guessing until it works. It's a method: reproduce the bug, read what the program tells you, form a guess, test it, narrow it down. One real bug traced start to finish, plus print and logging, debuggers in four languages, and git bisect.
- 16Git as a thinking tool
Git isn't just a backup or a way to share code. Used well, it makes you work in small, clear steps: one idea per commit, a diff you read before you commit, messages that explain why, branches for experiments, and safe ways to undo.
- 17Refactoring: clear over clever
Refactoring means improving the structure of code without changing what it does. Why tests come first, how to work in small safe steps, one messy function cleaned up from start to finish, why the shortest version isn't the best one, and when to leave code alone.
- 18How the web works
What actually happens between typing an address and seeing a page: DNS, a connection, an HTTP request, a response with a status code, and a browser that puts it together. With real requests and responses from a tiny PHP server, cookies, forms, redirects, and why HTTP forgets you between requests.
- 19Databases and SQL basics
Why most applications keep their data in a relational database, and the SQL you need every day: tables and keys, SELECT with WHERE and ORDER BY, JOIN, GROUP BY, NULL, constraints, transactions, indexes, and placeholders. Every example run against a real SQLite database.
- 20APIs and integration
Calling other systems, and being called by them. What an API is, JSON, why every request needs a timeout, retrying the right way, rate limits, pagination, idempotency keys so a retry doesn't charge twice, and verifying webhooks. Run against a small mock API, in Python and PHP.
- 21Concurrency basics
Doing several things at once makes programs faster and introduces a new kind of bug. Concurrency vs parallelism, why waiting is the usual reason to go concurrent, async in Python and JavaScript, race conditions you can reproduce, locks, Go's race detector, and the database version of the same bug.
- 22Security basics
Security isn't a separate skill bolted on at the end. It's the fundamentals applied with an attacker in mind: treat all input as untrusted, escape output, check who may do what, store passwords properly, keep secrets out of code, and keep dependencies updated. With real examples in PHP, Python, and JavaScript.
- 23From laptop to server
Code that works on your machine still has to run somewhere else, for real users, without you watching. Why 'works on my machine' happens, configuration in the environment, locked dependencies, the main ways to host an app, CI that builds and tests every push, logs, health checks, and how to deploy without fear.
- 24Reviewing code written by AI
AI tools write plausible code in seconds. Plausible isn't the same as correct. How to review generated code with the same standards as any other code: read it against the requirement, run it, pin expectations with tests, check what it hides, verify that packages and APIs exist, and own what you merge.
- 25Why fundamentals matter more in the AI era
The last part of the series. AI made typing code cheap; it didn't make understanding cheap. What changes, what doesn't, why skills fade when you stop using them, how to learn with AI instead of around it, and a map of the whole series as a checklist.