Good air, good light: really makes a difference. These are vent ducts leading up from the two bathroom fans in the upper floor bathrooms. One of the fans actually blows backwards into the bathroom. That is because the terminus of the vent is the hard surface of the ridge vent, so air blows up, has nowhere to go and it returns. This wears out the fan and obviously doesn't get the stinky, moist air out of the bathroom. In some cases it does cause mold in the attic. Warm, moist air condenses on the cold plywood in the winter. Both of these problems have a wide range of severity: from little affect to serious mold in the bathroom and deterioration of the roof deck. The solution costs about $200 apiece: cutting a hole in the roof and surrounding it with a hooded vent.
The code requirement for exterior venting started in 2003 and was clarified in 2006. Virginia follows the IRC. Here are the snippets:
International Residential Code (IRC) 2003
Chapter 15 - Exhaust Systems
SECTION M1506 MECHANICAL VENTILATION
M1506.2 Recirculation of air. Exhaust air from bathrooms and toilet rooms shall not be recirculated within a residence or to another dwelling unit.
International Residential Code (IRC) 2006
Chapter 15 - Exhaust Systems
SECTION M1501 GENERAL
M1501.1 Outdoor discharge. The air removed by every mechanical exhaust system shall be discharged to the outdoors. Air shall not be exhausted into an attic, soffit, ridge vent or crawl space.
Exception: Whole-house ventilation-type attic fans that discharge into the attic space of dwelling units having private attics shall be permitted.
2015 is the same as 2006.