A bug is a piece of code that is created to disrupt the normal performance of a computer system. Viruses can spread out rapidly and cause considerable damage to both individual computers and networks. Some infections are harmless, while others can erase files, corrupt data, and even damage hardware.