Good design is all about making life easier. But in the case of the coin-operated vending machine, the starting point was the idea of moderation.

The first recorded contraption was created in first century Egypt, when a man called Hero of Alexandria came up with a device for dispensing holy water in temples.

A coin was inserted in a slot, which pushed down a bar to release a precise quantity of water, so that no one could take more than their fair share.

Sorry, this audio has expired Hear more about the design icon that is the vending machine

In 17th century England, honour boxes containing snuff and tobacco for sale were opened using a coin in a slot.

To prevent customers from helping themselves to more than they'd paid for, the boxes were usually placed in a prominent position in a pub, so that the inn-keeper could keep a close eye.

The vending machine that we recognise today started in Britain, when a small machine that dispensed postage stamps was patented in 1857. This was followed in 1883 by a huge cast-iron dispenser made by Percival Everitt that sold postcards.

A further refinement meant the coin-slot closed when the machine ran out of stock.

Vending machines have become synonymous with the speed of US capitalism. ( Unsplash: Rich Helmer )

The idea was soon picked up in Germany, where manufacturer Max Sielaff designed machines to dispense chocolate bars and, later, drinks.

At a Berlin exhibition in 1896, he displayed a whole restaurant with food, entirely dispensed from coin-operated serveries.

In 1902, this inspired Horn and Hardart in America to open coin-operated cafeterias called Automats, in Philadelphia and New York.

Individual meals were displayed behind small glass windows allowing customers to pick and choose, before putting a coin in the slot and taking out their choice.

The public loved them, although the idea ran out of puff in the 1960s with the rise of fast food operators like McDonalds.

Even so, the last Automat soldiered on until 1991.

It wasn't only food that could be sold in this way. In the UK in 1937, publisher Allen Lane introduced vending machines that sold Penguin paperbacks in a contraption he called a Penguincubator, which proved popular in stations.

But the vending machine's spiritual home is Japan, with a staggering 5.5 million in use today.

With little vandalism and the Japanese passion for automation, machines are installed wherever needed, including on the streets.

They show that there's very little that can't be sold this way, from groceries and clothing to elaborate flower arrangements and even puppies.

These days vending machines sell anything from clothes to novels. ( Getty Images: Sharon Pruitt )

Fifty years ago, the vending machine inspired the ATM or cashpoint machine, dispensing cash using a token, before cashcards became ubiquitous.

Surely the joy of the vending machine is the freedom it gives us to buy what we like when we like without being watched.

An icon of liberty, certainly, but also of instant gratification.