For each person on Earth, there are 17 million flies. They pollinate plants, consume decomposing bodies, eat the sludge in your drainpipes, damage crops, spread disease, kill spiders, hunt dragonflies.

Some have even lost their wings so as to live exclusively on bat blood, spending their lives scuttling about the fur of their hosts, leaving only to give birth to a single larva – usually.

“That’s why I love them. They do everything. They get everywhere. They’re noisy. And they love having sex,” said Erica McAlister, a curator of Diptera – flies, to the rest of us – at the Museum of Natural History in London.

McAlister has captured her affection for the Diptera in The Secret Life of Flies: a short, rich book, by turns informative and humorous – both a hymn of praise to her favourite creatures and a gleeful attempt to give readers the willies.

Her book is also the source of the 17 million number, which, she pointed out, is just an estimate.

Like other fly writers before her, McAlister has more than fun in mind. She wants to remind the world at large of the importance of flies to humanity, and to the planet. They are not just something to swat.

Without them, to take just one example, there would be no chocolate. McAlister herself hates chocolate, but she is fond of the kind of flies that pollinate the cacao plant: a variety of biting midge. The midges are tiny, mostly blood-feeding insects, but the chocolate midges like nectar and carry pollen from one plant to another.

The word ‘mosquito’ is Spanish for ‘little fly’ – but the damage they can inflict is anything but little (AFP/Getty)

Biting midges are, in fact, part of McAlister’s specialty. She is fond of all flies, but focuses on those that are included in the lower Diptera, which include mosquitoes, black flies and, as she puts it, “everything that’s bitey, stabby, nasty”.

Her life among flies involves both museum work and field research. For her, this is a dream job. She recalled the first time she went behind the scenes at the museum, as a student, before she actually worked there.

“I’d been let into a building that had 34 million insects. I said, ‘Oh hello, I quite like you.'”

McAlister’s fascination began in childhood. “I used to catch the fleas off the cats,” she said, inspecting them with a microscope her parents had given her. But she soon gravitated toward more gruesome insects.

Decomposing carcasses of small creatures, also courtesy of the cats, were treasure troves of maggots, which she still delights in. “I quite like the darker side of nature,” she said, just before discussing the lives of spider-killing flies.

The larvae “hurl themselves at spiders” in order to land on them and burrow into the abdomen. They then eat the spider from the inside out. But if the spiders are immature, the larvae may go to sleep for a few years until the spider grows into a bigger meal.

Many flies do an enormous service for us and the planet by cleaning up all sorts of the biological world’s detritus, from dead wood to the slime in drainpipes. Drain flies, or sewer gnats, are actually cleaning up human mess.

Occasionally, however, they may have a population boom that sends the adults into the air, which is annoying; if the bodies disintegrate into tiny particles in the air, they are potentially harmful to human health.

And, of course, there are the flies that feed on dead bodies – the 1,100 species of blow flies, favourites of forensic detective shows. The maggots of these flies, like the very attractive bluebottle larva, devour corpses of mice and men and everything else.

Knowledge of which species lay eggs at which stages of decomposition can help determine how long ago a person turned into a body. (If it’s Tuesday, it must be a bluebottle.)

There are 160,000 known species of fly, and entomologists can only guess at the number we do not know – it is somewhere between hundreds of thousands and millions.

Within science, flies are one of the great subjects of laboratory study. Or rather, the fly: Drosophila melanogaster, commonly known as the fruit fly – although McAlister points out it actually belongs to a group called the vinegar flies.

There are 160,000 known species of fly, and entomologists can only guess at the number we do not know (AFP/Getty)

They are easy to work with and share the same basic DNA as all life. Historically, they have provided much of the foundation for modern genetics. And now they may provide deep insights into neuroscience and other fields.

Scientists at the Salk Institute have reported that their studies of how the fly brain works can improve internet search engines. At the Howard Hughes Medical Institute’s Janelia Research Institute in Virginia, the search is on to develop a wiring diagram of the fly brain, and then figure out in the greatest detail how they think.

And they do think, according to Vivek Jayaraman, who runs a lab there, in the sense that flies do not just react instinctively. Their brains make decisions based on several different inputs – smell, memory, hunger and fear, for instance. And that whole process is what he hopes to decipher, neuron by neuron. “You can go end to end, potentially, in the fly,” he said.

​McAlister said that her work and her book have bemused and pleased her relatives, including an aunt who is quite delighted to have an author in the family. “My parents were a bit confused to start,” she said. “But I was a middle child and they let me do my own thing.” Eventually, she said, they realised, “Oh, she’s done all right.”

Science news in pictures Show all 20 1 /20 Science news in pictures Science news in pictures Pluto has 'beating heart' of frozen nitrogen Pluto has a 'beating heart' of frozen nitrogen that is doing strange things to its surface, Nasa has found. The mysterious core seems to be the cause of features on its surface that have fascinated scientists since they were spotted by Nasa's New Horizons mission. "Before New Horizons, everyone thought Pluto was going to be a netball - completely flat, almost no diversity," said Tanguy Bertrand, an astrophysicist and planetary scientist at NASA's Ames Research Center and the lead author on the new study. "But it's completely different. It has a lot of different landscapes and we are trying to understand what's going on there." Getty Science news in pictures Over 400 species discovered this year by Natural History Museum The ancient invertabrate worm-like species rhenopyrgus viviani (pictured) is one of over 400 species previously unknown to science that were discovered by experts at the Natural History Museum this year PA Science news in pictures Jackdaws can identify 'dangerous' humans Jackdaws can identify “dangerous” humans from listening to each other’s warning calls, scientists say. The highly social birds will also remember that person if they come near their nests again, according to researchers from the University of Exeter. In the study, a person unknown to the wild jackdaws approached their nest. At the same time scientists played a recording of a warning call (threatening) or “contact calls” (non-threatening). The next time jackdaws saw this same person, the birds that had previously heard the warning call were defensive and returned to their nests more than twice as quickly on average. Getty Science news in pictures Turtle embryos influence sex by shaking The sex of the turtle is determined by the temperatures at which they are incubated. Warm temperatures favour females. But by wiggling around the egg, embryos can find the “Goldilocks Zone” which means they are able to shield themselves against extreme thermal conditions and produce a balanced sex ratio, according to the new study published in Current Biology journal Ye et al/Current Biology Science news in pictures Elephant poaching rates drop in Africa African elephant poaching rates have dropped by 60 per cent in six years, an international study has found. It is thought the decline could be associated with the ivory trade ban introduced in China in 2017. Reuters Science news in pictures Ancient four-legged whale discovered in Peru Scientists have identified a four-legged creature with webbed feet to be an ancestor of the whale. Fossils unearthed in Peru have led scientists to conclude that the enormous creatures that traverse the planet’s oceans today are descended from small hoofed ancestors that lived in south Asia 50 million years ago A. Gennari Science news in pictures Animal with transient anus discovered A scientist has stumbled upon a creature with a “transient anus” that appears only when it is needed, before vanishing completely. Dr Sidney Tamm of the Marine Biological Laboratory could not initially find any trace of an anus on the species. However, as the animal gets full, a pore opens up to dispose of waste Steven G Johnson Science news in pictures Giant bee spotted Feared extinct, the Wallace's Giant bee has been spotted for the first time in nearly 40 years. An international team of conservationists spotted the bee, that is four times the size of a typical honeybee, on an expedition to a group of Indonesian Islands Clay Bolt Science news in pictures New mammal species found inside crocodile Fossilised bones digested by crocodiles have revealed the existence of three new mammal species that roamed the Cayman Islands 300 years ago. The bones belonged to two large rodent species and a small shrew-like animal New Mexico Museum of Natural History Science news in pictures Fabric that changes according to temperature created Scientists at the University of Maryland have created a fabric that adapts to heat, expanding to allow more heat to escape the body when warm and compacting to retain more heat when cold Faye Levine, University of Maryland Science news in pictures Baby mice tears could be used in pest control A study from the University of Tokyo has found that the tears of baby mice cause female mice to be less interested in the sexual advances of males Getty Science news in pictures Final warning to limit "climate catastrophe" The Intergovernmental Panel on Climate Change has issued a report which projects the impact of a rise in global temperatures of 1.5 degrees Celsius and warns against a higher increase Getty Science news in pictures Nobel prize for evolution chemists The nobel prize for chemistry has been awarded to three chemists working with evolution. Frances Smith is being awarded the prize for her work on directing the evolution of enzymes, while Gregory Winter and George Smith take the prize for their work on phage display of peptides and antibodies Getty/AFP Science news in pictures Nobel prize for laser physicists The nobel prize for physics has been awarded to three physicists working with lasers. Arthur Ashkin (L) was awarded for his "optical tweezers" which use lasers to grab particles, atoms, viruses and other living cells. Donna Strickland and Gérard Mourou were jointly awarded the prize for developing chirped-pulse amplification of lasers Reuters/AP Science news in pictures Discovery of a new species of dinosaur The Ledumahadi Mafube roamed around 200 million years ago in what is now South Africa. Recently discovered by a team of international scientists, it was the largest land animal of its time, weighing 12 tons and standing at 13 feet. In Sesotho, the South African language of the region in which the dinosaur was discovered, its name means "a giant thunderclap at dawn" Viktor Radermacher / SWNS Science news in pictures Birth of a planet Scientists have witnessed the birth of a planet for the first time ever. This spectacular image from the SPHERE instrument on ESO's Very Large Telescope is the first clear image of a planet caught in the very act of formation around the dwarf star PDS 70. The planet stands clearly out, visible as a bright point to the right of the center of the image, which is blacked out by the coronagraph mask used to block the blinding light of the central star. ESO/A. Müller et al Science news in pictures New human organ discovered that was previously missed by scientists Layers long thought to be dense, connective tissue are actually a series of fluid-filled compartments researchers have termed the “interstitium”. These compartments are found beneath the skin, as well as lining the gut, lungs, blood vessels and muscles, and join together to form a network supported by a mesh of strong, flexible proteins Getty Science news in pictures Previously unknown society lived in Amazon rainforest before Europeans arrived, say archaeologists Working in the Brazilian state of Mato Grosso, a team led by archaeologists at the University of Exeter unearthed hundreds of villages hidden in the depths of the rainforest. These excavations included evidence of fortifications and mysterious earthworks called geoglyphs José Iriarte Science news in pictures One in 10 people have traces of cocaine or heroin on fingerprints, study finds More than one in 10 people were found to have traces of class A drugs on their fingers by scientists developing a new fingerprint-based drug test. Using sensitive analysis of the chemical composition of sweat, researchers were able to tell the difference between those who had been directly exposed to heroin and cocaine, and those who had encountered it indirectly. Getty Science news in pictures Nasa releases stunning images of Jupiter's great red spot The storm bigger than the Earth, has been swhirling for 350 years. The image's colours have been enhanced after it was sent back to Earth. Pictures by: Tom Momary

Flies can be startling in their appearance as well as their behaviour. One Middle Eastern fruit fly has patterns on its wings that look something like spiders. No one knows why. Another fly, Achias rothschildi, must swallow air to inflate its eye stalks when it first emerges as an adult.

There are, McAlister notes in her book, limits to even her affinity for flies. Houseflies, for instance, may be affected by climate change. According to one projection, the population could increase by 244 per cent by 2080.

“That’s a lot of flies,” she writes, “even for my tastes.”

Presumably, many flies will also suffer with climate change. A recent paper looking at all insects reported an apparent decline that may already be linked to global warming.

There are countless mysteries remaining in the fly world – big ones, like how many species of flies there really are, and more limited ones, like the insect with the big orange head, the bone skipper fly. It eats carcasses, but only ones that have been picked over, and comes out at night in the winter. It was thought to be extinct until it was rediscovered a few years ago.

McAlister is doing her part to recruit a new generation to solve these puzzles and others by appealing to the same instincts in young people that led her to seek out the spoils of hunting house cats.

“I was telling these kids about maggots and decomposing and why they’re fun,” she recalled. One of them later persuaded his father to leave a rotten chicken in the yard and to plant an iPhone nearby to make a video as it pulsed with the energy of its consumers.

Helpfully, father and son sent McAlister the video. She looks on the bright side: “Hopefully, by inspiring this little kid to have a rotten chicken in his garden, we can spark their interest.”

On such outreach rests the future of dipterology.