Answer: An exhaust fan in a bathroom is not a requirement according to building codes if you have the proper ventilation through what we call a "passive" system, which is basically a window or operable skylight. However, if you have no window, codes require you to have a mechanical method of removing moisture from the air, and that means an exhaust fan.
But even if you have a window, you should realize that the differential in pressure needed to move moisture out of the room, or a cross breeze, will create ventilation only if such conditions exists. The exhaust fan, on the other hand, will actively remove moisture and odors from the bathroom much faster than an open window in most cases.
Replacing an existing fan is fairly simple because there is prior ducting already in place. And I do recommend this. Older fans tend to be noisy, and when fans are noisy, people don’t turn them on. And a fan that’s not turned on is no better than no fan at all. You can also buy humidity-sensing fans that will turn on themselves when needed, helping to fight excess moisture and mold.
If you don’t already have an existing fan, your approach will really depend on the amount of room you have in your attic. If you have adequate room, you can duct through the attic and outside of the house through a side wall. There have been significant improvements in these fans over the years, and Nutone and Panasonic make some great models that are strong and quiet. The newer fans not only work better, they are also energy-efficient. The high-quality fans run $250 to $360 and are fairly simple to install. Panasonic has a helpful page of frequently asked questions on ventilation and fans.
Matt Plaskoff, a veteran Los Angeles contractor (license No. 660059), is CEO and founder of Plaskoff Construction and One Week Bath. He is a frequent expert on home improvement TV shows and former lead construction consultant of ABC’s "Extreme Makeover: Home Edition."