In the past I was a big fan of soffit vents. I figured if you used quality vents with a good back-draft damper, and sealed and insulated the duct well, it was a great way to vent bathrooms. There are several key benefits:
First and foremost, it avoids penetrating either the roof or a gable
wall, so it eliminates any risk of liquid water intrusion from
wind-blown rain or unsheltered gable walls. However problematic humid
air is for an attic, I think liquid water is an order of magnitude
worse..
It also allows for short efficient duct runs, keeps the duct low (in between
the floor joists), and therefore well underneath blown in insulation
(so you can use rigid duct and avoid the need for separate
insulation).
Finally using a soffit vent sort of creates a thermal trap- warm air
from inside the duct wants to rise not sink, so there should be less
heat less when the exhaust fan isn't running. Even with dampers at
the fan and the vent, those dampers are certainly not airtight. Often
the end of the duct often goes up a little bit before going down and
out the soffit vent, so that only enhances this thermal trap.
However despite all these benefits, which I think are significant, I'm starting to reconsider whether soffit venting is generally a good idea. I've done it this way in the past and I'm a little embarrassed that I never even considered the fact that a substantial portion of the exhaust air could get sucked right back into the soffit vent or adjacent soffit vents.
I do think that by closing off the soffit vents (into the attic) in the joist bay that you're venting from, and one on either side, will greatly mitigate this issue. The moisture should diffuse into the surrounding air very rapidly, especially when there even the slightest breeze. As will making sure the underside of these soffits is painted or otherwise moisture resistant. I also think it's important to realize that this is just bathroom air we're talking about, not a dryer vent, so while the air will be humid during showers it's not like we're blowing clouds of steam..
Also keep in mind that the whole point of soffit vents is to allow air to constantly wash along the underside of the roof decking, and remove any moisture from the attic, so any moist air that gets sucked in or condensation happening should be quickly removed- not saying that this can't possibly pose a problem (especially in winter), but I think there's a lot of built-in tolerance.
So I'm somewhat on the fence. I'm leaning towards thinking venting through a gable wall is better, especially if it is protected by an overhang, but I don't think soffit venting is as horrible as some make it out to be. And I would probably choose soffit venting over making another hole in the roof any day, for retrofit especially. I also think Dave makes a lot of good points.
This could be an option, as long as a few conditions are met.
There should be a damper
A damper will prevent outside air from entering the exhaust pipe, traveling down the length and entering the conditioned space. Most exhaust vent covers are designed in such a way, so that even on windy days the exhaust can still be exhausted. If you just have a pipe pointing to the outside, it's possible the outside air pressure can overcome the exhaust air pressure preventing the exhaust from exhausting.
There shouldn't be a way for the exhaust to reenter the building
If you simply close the window on a pipe that does not completely fill the opening, it's very likely that air pressure differences will force the exhausted air right back in the window. You'll want to devise a way to prevent the exhausted air from reentering the building. This other answer illustrates a way to install the vent, while blocking the entire window opening.
Best Answer
As far as I know, it doesn't really matter as long as it's vented outside. Venting into the attic is Very Bad -- in the winter, the humid air will condense and (if cold enough) freeze, and you'll effectively have water in the attic.
For any vents, the straighter the run is, the more efficient and quieter it is. Avoid corrugated pipes, and avoid bends and elbows as much as possible. For that reason, going into the soffit almost guarantees you'll have more bends than going through the roof.
As a DIY job, you'll also have to be sure you have the knowledge to cut a hole in the roof. I'd say it'd be far better to go out the side of the house (which is a bit easier to seal) than to go through the roof and cause a leak.