Imagine you're at a picnic and just about to bite into your sandwich. Suddenly you spot a fly headed your way, homing in on your food with help from its compound eyes and antennae. It manages to escape your swatting, lands on the sandwich and then seems to throw up on it!

It can look kind of gross, but the fly might be just airing out its own digested food, or spitting on yours.

Most of the over 110,000 known fly species have no teeth, so they cannot chew solid food. Their mouthparts are like a spongy straw. Once they land on your food, they need to release digestive juices to liquefy it into a predigested, slurpable soup they can swallow. In short, some flies are on a liquid diet.

To fit more food in their stomachs, some flies try to reduce the liquid in what they have already eaten. They regurgitate food into vomit bubbles to dry it out a bit. Once some water has evaporated they can ingest this more concentrated food.

Human beings don't need to do all this spitting and regurgitating to get nutrients out of our food. But you do produce a digestive juice in your saliva, an enzyme called amylase, which predigests some of the sandwich bread while you chew.

Amylase breaks down starch, which you can't taste, into simple sugars like glucose, which you can taste. That's why bread gets sweeter the longer you chew it.

Did you know flies can taste food without their mouths? As soon as they land, they use receptors on their feet to decide whether they're on something nutritious.

You may have noticed a fly rubbing its legs together, like a hungry customer getting ready to devour a meal. This is called grooming – the fly is essentially cleaning itself, and may also clean the taste sensors on the bristles and fine hair of its feet, to get a better idea of what is in the food it has landed on.

Should you trash food a fly's landed on?

When a fly touches down on your sandwich, that's probably not the only thing it's landed on that day. Flies often sit on gross stuff, like a dumpster or decomposing food, that's full of microbes. The germs can hitch a ride and, if the fly stays put long enough, hop onto your meal.

This is much more dangerous than their saliva because some of the microbes can cause diseases, like cholera and typhoid. But if the fly doesn't stay longer than a few seconds the chances of microbes transferring are low, and your food is probably fine.

To keep insects from landing on your food, you should always cover it. If your house is infested with flies, you can use simple traps to get rid of them. Carnivorous plants can also eat the flies and help control their population.

A doctor uses sterile maggots like those in these tubes to clean a patient's foot wound. (Norbert Försterling/picture alliance/Getty Images) (Norbert Försterling/Picture Alliance/Getty Images)

Above: A doctor uses sterile maggots from tubes to clean a patient's wound.

Are flies good for anything?

Spitting on food and spreading diseases sounds disgusting, but flies aren't all bad.

Watch closely the next time you're outside and you might be surprised by how many flies visit flowers to get nectar. They're an important group of pollinators, and many plants need flies to help them reproduce.

Flies are also a good source of food for frogs, lizards, spiders and birds, so they're a valuable part of the ecosystem.

Some flies have medical uses, too. For example, doctors use blow fly maggots – the young, immature form of flies – to remove decomposing tissue in wounds. The maggots release antiviral and antimicrobial juices, and these have helped scientists create new treatments for infections.

More importantly, the fruit flies you may have seen flying around ripe bananas in your kitchen have been invaluable in biological research. Biomedical scientists from all over the world study fruit flies to find causes and cures for diseases and genetic disorders.

And in our lab, we study what the world looks like to insects, and how they use their vision to fly. This knowledge can inspire engineers to build better robots.

So, although it's a nuisance to shoo flies away from your sandwich, maybe you can spare a few bits of your lunch?The Conversation

Ravindra Palavalli-Nettimi, Postdoctoral Research Associate, Florida International University and Jamie Theobald, Associate Professor of Biological Sciences, Florida International University.

This article is republished from The Conversation under a Creative Commons license. Read the original article.