Flies have a mobile head with eyes and in most cases have large compound eyes on the sides of the head, with three small ocelli on the top. For visual course control, flies optic flow field is analyzed by a set of motion-sensitive neurons. A subset of these neurons is thought to be involved in using the optic flow to estimate the parameters of self-motion, such as yaw, roll, and sideward translation. Other neurons are thought to be involved in analyzing the content of the visual scene itself, such as separating figures from ground using motion parallax. The H1 neuron is responsible for detecting horizontal motion across the entire visual field of the fly, allowing the fly to generate and guide stabilizing motor corrections mid-flight with respect to yaw. The antennae take a variety of forms, but are often short, which reduces drag while flying.
Because no species of fly has teeth or any other organ or limb that allows them to eat solid foods, flies consume only liquid food or finely granular foods, such as pollen, and their mouthparts and digestive tracts show various modifications for such diets. Female Tabanidae use knife-like mandibles and maxillae to make a cross-shaped incision in the hosts’ skin and then lap up the blood. The gut includes large diverticulae, allowing the insect to store small quantities of liquid after a meal.
The genitalia of female flies are rotated to a varying degree from the position found in other insects. In some flies, this is a temporary rotation during mating, but in others, it is a permanent torsion of the organs that occurs during the pupal stage. This torsion may lead to the anus being located below the genitals, or, in the case of 360° torsion, to the sperm duct being wrapped around the gut, despite the external organs being in their usual position. When flies mate, the male initially flies on top of the female, facing in the same direction, but then turns round to face in the opposite direction. This forces the male to lie on his back for his genitalia to remain engaged with those of the female, or the torsion of the male genitals allows the male to mate while remaining upright. This leads to flies having more reproduction abilities than most insects, and at a much quicker rate. Flies occur in great populations due to their ability to mate effectively and in a short period of time during the mating season.
The female lays her eggs as close to the food source as possible, and development is rapid, allowing the larvae to consume as much food as possible in a short period of time before transforming into adults. The eggs hatch immediately after being laid, or the flies are ovoviviparous, with the larvae hatching inside the mother.
Larval flies have no true legs. Some Dipteran larvae, such as species of Simuliidae, Tabanidae, and Vermileonidae, have prolegs adapted to such functions as holding onto a substrate in flowing water, holding onto host tissues, or holding prey. Roughly speaking, there is some anatomical distinction between the larvae of the Nematocera and the Brachycera (see Classification section, below); especially in the Brachycera, there is little demarcation between the thorax and abdomen, though the demarcation may be very visible in many Nematocera, such as mosquitoes (see image, both here and in the mosquitoes article); in the Brachycera, the head of the larva is not clearly distinguishable from the rest of the body, and there are few, if any, sclerites. Informally, such Brachyceran larvae are called maggots, but the term is nontechnical and often applied indifferently to fly larvae or insect larvae in general. The eyes and antennae of Brachyceran larvae are reduced or absent, and the abdomen also lacks appendages such as cerci. This lack of features is an adaptation to food such as carrion, decaying detritus, or host tissues surrounding endoparasites. Nematoceran larvae generally have visible eyes and antennae, though usually small and of limited function.
The pupae take various forms, and in some cases develop inside a silk cocoon. Despite the myth that flies only live a day (which may have either arisen from confusion with the mayfly or the fact that a fly inside a house may starve to death in a few days), most adult dipterans can live about one month.