The problem can be reduced by good sealing of connections as already mentioned with heatshrink tube, especially the type that has a layer of glue inside.
In addition, it is a good idea to make the solder or crimp connection on the wire and then soak it in WD40, or thin oil and let that capillary up the wire for a few inches. (just like the salt water will do if it is given the chance) Then liberally coat the terminal/pin whatever in silicone grease, which is a bit like Vaselene to look at, but way better. Think of it as WD40 in grease form. Better still, if crimping, coat the bare wire end in silicone grease before you crimp the terminal, as well as all the above! Wire ends treated this way will be massively protected from corrosion and are generally hassle free in horrible environments for months if not years! (salt water/boats etc)
In all cases the copper starts corroding at any point that it is exposed. Even the usual PVC insulation is to some extent porous, so we are on a hiding to nothing if we run the boats in salt water or let batteries spill acid or puke out acidic fumes. Cheap equipment wire is only bare copper strands. One step better is tin plated copper wire, which is virtually the same price, followed by silver plated copper wire, which is ten times the price, and is usually insulated with PTFE into the bargain, which makes it very rugged indeed! (which is why it was used in missile (Polaris) wiring looms.) If you have the money, RS components stock it! (part no 726-7400 for some thin pink stuff at £8 for 25 metres). You can even chuck so much current down it that it glows red hot, and unless you actually blow it like a fuse it will still be intact, but the silver plating will have evaporated, but that is way better than being on fire and shorting out to it's surroundings like it's PVC counterpart would be doing. It is brilliant stuff. It comes in lots of colours and sizes, but costs the earth.....the pink stuff is cheaper because it is the main colour the military uses....almost all the wires they use are the same colour and are marked with slide on markers for identification......Oh, and if you do try the glowing wire trick, don't breathe the white smoke that belches out of each end of the wire.....it may shorten your life a tad.