browse/
45 results
software-design/unit-tests-why-four-passing-tests-don-t-prove-a-function-works.md
Unit tests: why four passing tests don't prove a function works
Your function gave the right answer four times. Is it correct? Not necessarily: passing tests only show the bug isn't where you looked…
computers/floating-point-why-0-1-0-2-is-not-exactly-0-3.md
Floating point: why 0.1 + 0.2 is not exactly 0.3
Type `0.1 + 0.2` into JavaScript or Python and you get `0.30000000000000004`. It is not a bug, and it is not your mistake. Computers store…
web/the-dom-how-a-browser-turns-html-text-into-a-tree.md
The DOM: how a browser turns HTML text into a tree
A web page starts as plain text, yet a script can add a bullet to it while it is open. How? The browser never works on your text directly…
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/offline-sync-what-happens-when-two-phones-edit-the-same-contact.md
Offline sync: what happens when two phones edit the same contact
You edit a contact's phone number on a plane. Your partner fixes the city on a tablet. Both devices are offline, then both reconnect. Which…
software-design/idempotency-why-clicking-pay-twice-should-charge-you-once.md
Idempotency: why clicking Pay twice should charge you once
You tap Pay, the screen shows an error, you tap again, and your card is charged twice. Networks drop messages, so a phone often cannot tell…
infrastructure/ci-pipelines-how-a-computer-decides-a-change-is-safe-to-merge.md
CI pipelines: how a computer decides a change is safe to merge
Push a change and a green tick or a red cross appears a minute later. How does a machine decide? It does not understand your code. It reads…
computers/race-conditions-why-two-people-adding-1-to-5-can-leave-you-with-6.md
Race conditions: why two people adding 1 to 5 can leave you with 6
Two phones add one item to a shared list of 5, and the list ends up at 6 instead of 7. Nothing is broken, yet an update was lost. This is a…
software-design/state-machines-why-an-order-can-t-be-delivered-before-it-s-paid.md
State machines: why an order can't be delivered before it's paid
An online order can be in the cart, paid, shipped, delivered or cancelled, but what stops the code from delivering an order nobody paid…
tools/path-why-a-terminal-says-command-not-found-for-a-program-you-installed.md
PATH: why a terminal says command not found for a program you installed
You installed a tool, but the terminal says `command not found`, or it runs an older version. The cause is almost always `PATH`: a short…
networks/cidr-and-subnets-what-the-24-in-192-168-1-0-24-means.md
CIDR and subnets: what the /24 in 192.168.1.0/24 means
What does the `/24` in `192.168.1.0/24` mean? It counts how many of an IPv4 address's 32 bits name the network, and how many are left to…
computers/bits-and-bytes-why-a-byte-can-t-count-past-255.md
Bits and bytes: why a byte can't count past 255
A byte is eight on/off switches, and that tiny size explains a lot of odd bugs. In this article you flip the bits of one byte yourself and…