You want the shortest distance possible, and for everything except perhaps the dryer connection, you want to use rigid metal tubing rather than the flex tube. The rigid tubing will resist the airflow less and collect less lint. The better airflow from rigid tubing and shortest distance will make the dryer more efficient. If too much lint builds up in the vent, you have a fire hazard in addition to longer drying time.
I'd also suggest having the exhaust somewhere you can reach with a small step ladder to make it easier to clean the vent. So I'd run it down through the floor rather than up through the ceiling, if possible.
Finally, when you install the vent opening in the side of your home, make sure it's weather tight. If it's vinyl siding, you can get a removal tool (it's a flat blade with a hook on the end that pulls two pieces apart). Take off a few pieces where you're working, securely attach the vent, seal around the edges (not sure if Tyvek tape is good enough, they make a rubber adhesive membrane for window openings), install a few pieces of J channel like you have around windows and doors, and cut (measure twice) and reinstall the siding. Vinyl siding screws should remain loose (should be able to slide a fingernail underneath) so that it can expand/contract with heat/cold.
You can easily run an exhaust fan through a window opening. Look at all the window mounted air conditioners. Same concept without the cooling capability. The main constraints are cost and appearance. As you can imagine, the more handsome the installation, the more it will cost. You basically will want to use a small square duct fan, similar to a very small box fan or very large computer fan. You should consider at least a short duct so you can incorporate a backdraft damper to minimize infiltration when the fan is not in use. You may also want a louvered grille for appearance or privacy reasons. Depending on how this is accomplished, the exterior decorative bars may need to be reworked slightly.
It sounds like this window is in or above the shower itself. In such a case, all electrical work will need to be approved for wet locations (I believe if above 72" from floor, only damp location measures are required, but please verify this). The simplest installation would be to open the window, run the duct through the opening and close off the remaining opening with an insulated panel of some sort. The sliding panes will need to be fixed in place somehow for security. Fan wiring can be run in surface mounted EMT tubing.
A better solution is to remove the wood window, which is not the best material for wet locations. Install the fan/duct and some minimal infill framing in the rough opening. Any wood in contact with masonry should be pressure treated. Install a new PVC window in the new, smaller opening, with obscure glass. A cleaner look will be achieved if you can hide the fan wiring behind finished surfaces. Depending on existing conditions, this can be somewhat simple or quite expensive.
A glass brick solution is also possible. Depending on the size of your opening and the brick module size, it may be an excellent or poor solution. Ideally, you may need no infill panel at all, the duct may fit nicely in one corner. Or so much infill is needed that the glass brick solution is just too visually insubstantial to be worth doing at all.
Best Answer
I believe what they mean by plumbing the vent downward is to make sure it has a slight slope so that moisture condensation from venting a shower will not drip water back into fan unit and cause problems.