Having a bit of an electronics background, I might suggest leaving the battery hooked up. It represents a low impedence for the 12 volt positive supply. Leaving the positive terminal off, could actually cause induced (harmfull) voltages to get into your computer via the open 12 volt buss. This is only my theory on the matter.
In general, when welding on a vehicle, it is good to place your welder ground as close to the work area as possible and not through a bearing or other bolted on part that may have a grounded electrical device. In other words, you don't want the welding return path to try and go through your electrical system ground.
This advice is the best in this thread. I've discussed this topic with electrical engineers where I work, and the consensus is that the battery will act as a capacitor, equalizing the circuit. You are far more likely to cause damage without it connected than you are if you leave it alone.
That being said, the best thing you can do is keep the ground very close to where you are welding. Don't slap the ground on the frame and weld on the exhaust for example.....you can not only damage electronics but you can melt grounding straps that are not capable of carrying the current between the two major components.
A decent write up I found in another forum:
"Having repaired computers in an earlier life, I'd like to think I know something about electronics. Electronics obey the same rules of ohms law as the steel you weld on. Although electronics don't need much in the way of current to fry them. Voltage spikes or voltage above limits of the equipment will damage it. However, modern electronics, especially those in a hostile environment such as a vehicle, have snubbing circuits, shielding, etc. An old model car, just hook up the work clamp very near where you are welding and weld. That is probably more important than anything else. Attach the work clamp to the rear bumper and weld on the front bumper, and you just increased your chance of frying something. The weld current has to pass along the length of the car and the paths taken by the current are unknown, possibly through components you did not intend to.
The problem basically is a difference of potential (voltage) between two points, say your ECU (your engine computer) and ground. Leaving the battery connected MIGHT actually help protect the electronics as a battery is low impedance and would equalize the voltage difference between the + and the - as the current would readily pass through the battery.
However on late model cars there is really a small
"internet" interconnect of a lot of different "computers". To be safe here, disconnecting the computers from the cabling (power included) would be more prudent then disconnecting the battery as all the computers are connected together. Disconnecting the battery does nothing except remove a helpful voltage equalization path thus allowing MORE chance of damage."