Why do computers get viruses

Before we can answer this question we must consider what a virus actually is. At the simplest level a computer virus is software. Just like Windows or Linux, just like Office or Photoshop, a computer virus is a collection of sequential instructions written to tell a computer what to do. Today, a computer virus is regarded as a specific kind of a much larger group of software known as malware, or malicious software. This is somewhat of a misnomer in actual fact, because in the strict definition of a computer virus it does not actually have to be malicious. There are two identifiable traits that make a virus what it is: a search routine and a copy routine. A virus must first be able to locate other files to infect, and then it must be able to copy itself into them. Therefore, a virus is self-replicating and infects other files on your disk.

These terms have become a little murkier in today’s terminology because of programs that cross boundaries. For example, programs exist that replicate across a computer network, like a traditional computer worm but then also then infect other files on each host like a virus. There are also the much newer categories of malware: spyware and adware. Something of a plague on today’s internet, spyware and adware use many techniques from traditional viruses in order to evade detection by scanners and to persist on the computers they infect. In general though, a virus will still find its way onto your computer through software.

The other aspect of identifying computer viruses involves the payload. Some viruses will be designed simply to exist, but most will have a purpose. Trojan software for example will often use virus techniques to ‘survive’ but its real purpose will be to open a window to the internet which can then be exploited by a hacker to gain manual access to a computer. Others will be designed to cause mayhem and destruction by deleting files, interfering with other software, stealing information or even ruining the whole computer. A popular method in the past was the logic bomb, so called because it was set to ‘detonate’ at a particular time of the author’s choosing, executing its malicious code.

As for the question of why people write viruses, the answers are not so simple either. Viruses have been used for a multitude of reasons and by many types of people, from blackmail and extortion, corporate espionage and electronic warfare to simple disruptive behaviour and teenage pranks. Some write viruses simply because they can, others write them for the intellectual challenge and still others write viruses for profit. Even the military have been known to use computer viruses and worms in their technological toolkit.


The only real way to stay safe from computer viruses is to purchase an up-to-date virus scanner and scan everything before you install it. This won’t protect you completely, but it will minimise the risk of becoming infected. You should also never open an email attachment unless you know and trust who sent it, and only if you were expecting the email. Try to avoid downloading software from non-reputable websites whenever possible as well. If you are vigilant, the chances of a computer virus finding its way onto your computer are very slim.