Notes
Notes on building software and running systems
No notes match that search.
Error 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.
From 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.
Functions: 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.
Git 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.
How 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.
Loops 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.
Memory: 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.
The 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.
Reading 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.
Refactoring: 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.