I have learned that powering a chip without ground is quite dangerous and might cause permanent damage to the chip or the board in general. I have also seen that happening many times in non isolated DC to DC step down converters and some microcontrollers as well.
How can I prevent that from happening? Assuming I have a board with a non isolated switching regulator and a microcontroller that is connected through a UART to a USB to serial cable or to another board. How can I prevent the current flow if the ground disconnects first or the positive line connected before ground?