A bug is a piece of code that is created to disrupt the typical functioning of a computer. Viruses can spread quickly and trigger significant damage to both private computers and networks. Some viruses are harmless, while others can delete files, corrupt data, or perhaps damage hardware.