Composting is a proven way to increase the quality of the soil you use in gardening while making good use of the waste from your yard and kitchen. Unfortunately, one of the biggest problems you'll run into when composting is flies. The manure and food scraps in the compost pile are very attractive to these little pests. There are ways to combat them, however -- even out here in the smelly compost heap.
The gardening blog SheKnows.com recommends turning and stirring the compost pile every two or three days. If that doesn't work, try pouring boiling water on the pile. Your compost needs water anyway, and the heat will effectively kill the flies and their larvae.