OK, there are several different schools of thought on this; some purists insist on routing the cable housings straight forward, exiting the handlebar in a straight line and curving back to the stops like this picture. This is the way most factory rigged barcons left the factories. The theory is that by minimizing the cable housing bends, internal friction between the cables and the cable housings is minimized.
Some think the friction issue is a red herring and run the cable housing inside the bar tape all the way to the end of the tape near the stem.
What works for me is to set up the cable housing exit near the brake levers. That way, the cable bends (and friction) are minimized, but it doesn't look as weird as the factory rigging.