Protecting your programming laptop / computer against surges

Hi all, is there anyway to protect the computer I'm using? I use a surface pro 4. I have in the past, while using a 12v power supply had a fault with a board and the current destroy the USB port. I now program through a hub, but still unsure if there's anyway to protect the unit.

Is the only true way to protect from programming issues disconnect everything?

Any advice for a newbie helpful!

Is the only true way to protect from programming issues disconnect everything?

You won't destroy your USB port with programming errors but you might do it with wiring errors. Using a USB hub is a good way to protect against such errors but you must ensure you're using a hub with it's own power and power isolation from the host. In my experience not all self-powered hubs fulfill this requirement.

There are USB protection connectors available that actively protect the PC hardware but a good hub is usually the cheaper alternative.

I do agree it was likely a wiring error. My own likely!

I'll look for a USB protection connector, thanks for the advice. Makes sense they would exist but never even thought to look for one.

Thanks mate!