Most of us take modern restrooms for granted, but proper sanitation is a relatively modern phenomenon and is still far too rare in the poorest regions of the world.

The need to keep human and animal waste away from human contact may seem obvious today, but for millennia that was not the case. Before the emergence of the germ theory of disease, and the subsequent public health campaigns and construction of adequate sanitation infrastructure in most of the world, people and waste commingled – with catastrophic results.

Countless millions of people got sick or died from diseases such as diarrhoea, ascariasis (a type of intestinal worm infection), cholera, hepatitis, trachoma, polio, schistosomiasis and so on.

In due deference to our ancestors, it has to be noted that some cultures, such as ancient Rome, paid due attention to cleanliness. The Romans built numerous public baths, which were accessible even to the very poor for a nominal fee, and a sophisticated system of sewers that enabled Rome to grow and reach a population of over 1 million people around the start of the first millennium. That feat would not be replicated in Europe until London and Paris in the 19th century.

In general, however, standards of hygiene tended to be very poor. A typical urban dwelling had a cesspit underneath the house or next to it. That’s where human and kitchen waste accumulated and fermented. Inadequate drainage, irregular emptying and heavy rains could make the cesspit overflow and seep into the house. While discouraged by the city authorities, people often emptied their chamber pots into the streets below.

As Johan Norbeg of the Cato Institute wrote in his 2016 book Progress: Ten Reasons to Look Forward to the Future, “When pedestrians heard the shout of ‘Gardyloo!’ they ran for cover. This phrase, taken from the French for ‘Look out for the water,’ was your only warning that someone was about to throw their waste out of the window.”

In rural areas, people lived with their animals, including chickens and cows, and used both animal and human waste to fertilise their crops – an extremely dangerous practice compounded by the fact that people could go throughout much of their lives without ever washing their hands. That led to epidemics of disease as well as other unsavoury consequences.

The Jews, who sometimes died at lower rates than the rest of the populace thanks to the frequent washing of hands that is prescribed by Judaism, were often accused of witchcraft, persecuted and even killed.

The Black Death, which killed between 30 and 60 per cent of the European population in the 14th century, complicated matters further. According to some medical experts of the day, “once heat and water created openings (pores) through the skin, the plague could easily invade the entire body.” As such, even the rich and powerful tended to avoid bathing. Elizabeth I took a bath once a month, “whether she needed it or not,” but her successor, James I, only washed his fingers.

The Journal de la santé, which was kept for Louis XIV by his doctors from infancy until a few years before he died, described the king’s daily life in microscopic detail, but mentioned bathing only once. His magnificent palace of Versailles had no proper waste facilities and people relieved themselves where they stood – in the hallways, behind the curtains and in the gardens.

One 18th century observer noted that Versailles was “the receptacle of all of humanity’s horrors – the passageways, corridors and courtyards are filled with urine