browse/

11 results
computers/endianness-why-the-bytes-of-a-number-can-be-stored-backwards.md Endianness: why the bytes of a number can be stored backwards Store the number 0x12345678 in memory and you might expect the bytes in the order 12 34 56 78. Most laptops and phones store them as 78 56… 5 min read · 7 Nov computers/virtual-memory-why-two-programs-can-use-the-same-address-without-clash.md Virtual memory: why two programs can use the same address without clashing Two programs can both use "address 4096" without ever touching each other's data. The trick is that the addresses a program sees are… 6 min read · 29 Oct languages/reference-counting-how-python-knows-when-to-throw-an-object-away.md Reference counting: how Python knows when to throw an object away You never tell Python to free memory, yet unused objects disappear. How does it know when one is finished with? CPython keeps a tally on… 5 min read · 28 Oct languages/generators-how-a-python-function-can-pause-in-the-middle-and-pick-up-w.md Generators: how a Python function can pause in the middle and pick up where it left off A generator is a Python function that can pause halfway, hand you a value, and carry on later from the same line with its variables intact… 4 min read · 25 Oct computers/the-call-stack-why-a-function-that-never-stops-crashes-your-program.md The call stack: why a function that never stops crashes your program Every time a function is called, the computer puts a small block of memory called a frame on top of a call stack, and removes it when the… 5 min read · 23 Oct languages/rust-ownership-why-let-b-a-makes-a-unusable.md Rust ownership: why let b = a makes a unusable Why does Rust refuse to compile `let b = a;` followed by a use of `a`? Because of ownership: every value has exactly one owner, and… 5 min read · 19 Oct mobile/app-lifecycle-why-your-phone-forgets-what-you-typed-when-you-switch-ap.md App lifecycle: why your phone forgets what you typed when you switch apps You switch apps for a minute, and when you come back the message you were typing is gone. Nothing was broken: the phone needed memory… 4 min read · 13 Oct languages/go-slices-why-appending-to-a-copy-can-change-the-original.md Go slices: why appending to a copy can change the original Change a copy of a Go slice and sometimes the original changes too. The reason is that a slice is only a small window onto an array, with a… 4 min read · 10 Oct computers/cpu-cache-why-reading-a-grid-by-rows-beats-columns-step-by-step.md CPU cache: why reading a grid by rows beats columns, step by step Two loops add up the same grid of numbers, yet one can run about ten times slower. The reason is a small, fast memory inside your processor… 5 min read · 7 Oct computers/the-call-stack-how-your-computer-remembers-where-to-come-back-to.md The call stack: how your computer remembers where to come back to When one function calls another, how does the computer remember where to come back to? It keeps a pile of frames called the call stack… 5 min read · 4 Oct computers/why-your-computer-forgets-unsaved-work-when-the-power-dies.md Why your computer forgets unsaved work when the power dies Your computer has two kinds of memory. Storage (the SSD or hard drive) is a big filing cabinet that keeps files with the power off. RAM is… 10 min read · 1 Oct