Answer by Tim O'Neill, atheist, medievalist, skeptic, and amateur historian:
The idea that people emptied chamberpots out windows into the street is one of the images of the past that has been taught to generations of school children. It's usually said to have been done in the Middle Ages, and it's an image that has stuck with many people, particularly because we find it so disgusting. Unfortunately, like many popular ideas about the Middle Ages, it's largely nonsense.
People in the Middle Ages were no less sensitive to foul odors or disgusted by human waste than we are. They also did not understand exactly how human waste could spread disease, but they knew it did—they just thought it was something to do with its odors. So medieval towns and cities actually had a lot of ordinances and laws to do with waste disposal, latrines, and toilets. In medieval London, for example, people were responsible for the upkeep and cleanliness of the street outside their houses. The fines that could be imposed on them if they didn't do this could be extremely onerous. One account talks of an outraged mob badly beating a stranger who littered their street with the skin of a smoked fish, since they didn't want to have to pay the heavy fine for his laziness. In an environment like that, people are hardly going to be dumping buckets of excrement out of their windows.
Larger houses had enclosed latrines attached to or behind the home, which emptied into deep cesspits. These were called a "jakes" or a "gong," and the men who were employed to undertake the foul-smelling task of emptying these pits were called "gongfermours" or "gong farmers." Not surprisingly, these men were well-paid, and the gongfermours of medieval London usually ended their day with a much-needed dip in the River Thames.
Smaller residences made do with a bucket or "close stool" over a basin, either of which was emptied daily. They were usually carried to one of the streams that emptied into the nearest river and emptied into the water. This made some of these streams, like the Fleet, rather foul-smelling and gave one in the city of Exeter the lyrical name of "the Shitbrook." There were also public latrines maintained by the city of London, like the large communal municipal latrines on London Bridge that emptied into the river.
So like most things "everyone knows" about the Middle Ages, this one is in the same category as cumbersome heavy armor, the belief in a flat Earth, and medieval people eating rotten meat covered in spices—it's a myth.
More questions on History: