Why do AC adapters have long cable on both ends? I believe that almost everyone using one would want it either directly next to the gadget it is powering (even possibly joined together with it if possible) or next to the power plug (possible made into a single unit with the power plug). It is inconvenient to have it hanging in the middle of a power line. Is this simply a design flaw, or does it have particular reason?
If I were to replace either the AC side or the DC side cable with a very short one, does it have any difference between the two options electronically?
Usually for thermal management or mechanical compliance.
- thermal -- placing the power supply away from the potentially hot device and away from the wall (better airflow) results in the most efficient operation.
- mechanical -- large power supplies would block adjacent outlets if connected directly. They can also be heavier than can be safely suspended (hung) from wall outlets.
Basically no... except for the above mentioned reasons.
Two main reasons. Ease of use, and appearances. Ease of use because sometimes the power supplies are too bulky or heavy to plug right onto a outlet or power strip. You can even buy mini extensions just so that you can plug a wall wart into a power strip without taking 4 spots.
On the other side, it can be extended for the same reason. A power adaptor might be a pound or three, and you wouldn't want that extra weight on a laptop or monitor. And then there is aesthetics and appearances. The cable length allows the bulky, ugly power adaptor to be hidden. Again, with like a monitor or printer or anything really, you don't want to have to put the power adaptor right next to the device, on a desk, or hanging half way off the device. You get a generous length so it can go flat on the ground where it can't be seen, where it will get proper air flow as well.
When doing EMC testing in order to meet legislation a long cable on the AC end can reduce the conducted emissions back to the AC because of the filtering the longer cable provides. This assumes the adapter is a switch-mode type. The longer cable can reduce the adapters susceptibility during EMC testing too.
I think there is one more reason, outside of what has been mentioned already. Laptop power supplies can be changed to be used in multiple countries just by replacing the cable that connects the power supply to the outlet. Specifically, what I have in mind is the C13/C14 connector:
(image credit: Museo8bits via wikimedia commons)
If there were no cable to replace, similar flexibility w.r.t to outlet types would require replacing just the prongs, which could be more mechanically difficult. Also given that large (computer) power supplies can use the same cable, and such power supplies require a cable (you cannot locate a desktop power supply immediately adjacent to the wall), the same cable can be used both for desktop power supplies and laptop power supplies, increasing their utility and ubiquity.
The AC cord has to be long enough that the user can put the box on the floor, even if the outlet is fairly high on a wall somewhere, or otherwise in some inconvenient place. With cables, it's better to err on the side of too long. A few inches of excess length is a minor inconvenience compared to a few inches of insufficient length.