
How a computer's 'Undo' button remembers past actions
Computers aren't actually clever enough to remember the past; they’re just obsessive record-keepers. Think of it like a stack of dirty dinner plates after a seaside roast. Every time you click or type, the computer adds a new plate to the pile, documenting exactly what you just did.
When you hit 'Undo,' it doesn't travel back in time. It simply looks at the top plate, sees the 'inverse' instruction—like un-spilling the gravy—and performs it. It’s a lot of digital faff just to hide a typo, but it works a treat.
Eventually, even the biggest kitchen runs out of counter space. Computers have a set "undo limit," meaning they can only balance so many plates before the whole thing becomes a hazard.
When the stack gets too high, the computer simply tosses the oldest plate at the bottom into the bin to make room for a new one. It’s a bit ruthless, really.
That’s why you can’t always undo your way back to the very beginning of a project. Once those oldest records are cleared away to save memory, they're gone for good, no matter how much you faff about with the buttons.
Spot on, dear. It’s exactly like clearing the table after a long Sunday lunch. Once you shut the program down, the computer decides the party is over and tips the entire stack of plates straight into the soapy water.
It doesn't want to keep lugging around the history of your indecision once you've saved the final result. That memory space is needed for the next chore, so it wipes the slate clean to make room.
Unless you're using very fancy kit that saves a permanent logbook in the pantry, those old clicks and typos are washed away for good. It keeps the digital house tidy, even if it feels a bit heartless.
If the power cuts out, it’s like a sudden gale smashing every plate on the table. Those records live in 'short-term' memory—a digital card table that needs constant electricity to stay standing.
The moment the lights flicker, the table collapses and your history of faffing vanishes. You can't glue those shards back together once the current stops. It’s a right mess, frankly.
Saving is the only way to move your work into the permanent pantry. The undo stack, however, stays on that wobbly table, doomed to break if the power fails.
It’s all about the shelves, dear. While the card table relies on flighty electrons that vanish, the pantry uses "non-volatile" storage. It’s like the difference between writing in the sand and carving into a wooden bench.
Old hard drives magnetize spots on a spinning disk—like putting a permanent sticker on a jam jar. Even if the house goes dark, the sticker stays stuck.
Modern ones trap charges inside tiny, sturdy "cages." They stay physically locked in without any extra faff or constant current. It’s a much sturdier way to store your digital preserves.
Related topics
How sorting algorithms organize a messy tin of buttons
The gravity-defying drainage system of human sinuses
The Gruen effect in shopping mall layouts
The Statue of Liberty's original design for the Suez Canal
The puffing up of a sealed bag of coffee beans
The Chevalier d'Eon's gender reveal betting pools in London