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…
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…
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…
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…
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…
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…
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…
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…
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…
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…
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…