Whoever builds the home, should put the dryer vent on the outside of the home, so that it’s a 2-3’ run directly outside, and it will be much less likely to get clogged, therefore your clothes dry faster for longer, and less chance of a fire.
However, a lot of homes are built with the laundry room in the middle of the home; So the dryer vent ought to be ran straight through the attic, then roof. Sometimes there is need for a 30 degree elbow in the roof, to avoid hvac or plumbing, and that is fine.