The difference between a bug and a virus

3 Conversations

There are two aspects to this question : the biological aspect, and the digital aspect. Please skip to the one that presently concerns you, or read the aspect you are most comfortable with.

- 1 -

The Biological Aspect

A bug is a general term for the more precise though no less general term "insect". Some other animals, notably some arachnids (spiders, scorpions) are also considered in this category, which is why there are many people who still think spiders are insects, which they aren't.

Bugs generally range in size from a few milimetres to maybe 10 centimeters for the big ones, although there are some insects that are so small as to be invisible to the naked eye (just put a dust bunny from your bedroom under a microscope, and you'll see what I mean...).

But one important thing remains : bugs are multicellular animals. Even the small ones are composed of many cells.

A virus, on the other hand, is not even a whole cell in itself. Instead, it is a piece of genetic code (like DNA) that invades a healthy cell, and tries to place its code in the place of the cell's regular genetic code, in order to make copies of itself and spread itself into the infected organism. So viruses are MUCH smaller than bugs, and don't "work" in the same way, biologically.

The problem comes from some people saying : "I think I've caught a bug" when they're sick when they shold be saying : "I have been invaded by incredibly small organisms, the smallest organisms that are still considered to be alive, and am infected by their disease. I now function as an incubator for their genetic code. I am sick".

One could hardly blame them.

- 2 -

The Digital Aspect

Bugs are a defect in a computer program (or a feature in the case of some pieces of software).

The term comes from one of the very first computers, where a programmer, after slaving for hours at trying to find why his program wasn't working properly, found that a moth had gotten stuck inside the computer (computers were huge at that time, sometimes filling whole floors of large buildings, sometimes the buildings themselves were the computers...) and was shorting a relay or some such component.

The term stuck, and is a good example of a biological term getting adopted into computer-speak.

Bugs now usually come from oversights in the programming of software, or because not all the possible conditions of the program could be tested completely. This means that by using a piece of software long enough, you might trigger the right combination of inputs, outputs and internal conditions that might not have been anticipated by the programmers and then the software can start to behave unpredictably.

The Y2K bug, which is now famous, is a good example : about 20 years ago, the operating systems in use were Unix, DOS, and a few others that weren't in wide use. DOS and some of the others used only 2 digits for representing the year in a date. At the time, computer memory was costly, so saving a byte or two in every date written amounted to large (for the time) space savings. It was never thought that the same software and hardware might still be in use when the new millenium would start, so no problem was anticipated until a few years ago. Systems that still have the bug can start behaving unpredictably if they go past the december 31st 1999 11:59pm instant.

UNIX won't be affected by the Y2K bug, because it counts time differently : it counts the seconds that have elapsed since midnight, January 1st, 1970. It may be susceptible to a similar bug when that number of seconds becomes equal to the number 2 to the power of 32, which is sometime in 2106... But at that time, the limit will probably have been bumped back to at least 2 to the power of 64 (or has it already been?) So UNIX is a good example of foresight instead of oversight, which is the best way of not becoming a victim to bugs.

Viruses came later, the first one having been created (as far as I know) on an Apple Macintosh computer for the purpose of exploring the machine. This is especially notable since there aren't that many viruses that can infect Macs and the majority of viruses try to infect DOS-based and MS-Windows based systems.

A digital virus has similarities with biological viruses in that it too is code that seeks bigger programs in order to reproduce its code.

Typical viruses infect executable files by placing a "jump" instruction at the beginning of an executable, and then adding its own code to the end of the file, so that when the program is run, the virus is first run, which infects memory, letting the virus infect other executable files, and then jumps back to the program itself, as if nothing had happened.

That is the "regular" form of virus, but there are others...

It should be mentioned here that viruses may cause bugs, by making some programs on a computer unstable, but it is extremely improbable (though not impossible) that bugs may cause viruses by themselves. They might help viruses to spread, though.

Also, biologically, bugs may carry viruses, but the other way round is not possible.

The best way not to get a virus is to stay isolated, whether the virus is biological or digital in nature. But completely isolating your computer from the outside world would mean not visiting H2G2, which COULD be a bigger loss ultimately than the risk of getting a digital virus.

The power to resolve this dilemma is now in YOUR HANDS!

Bookmark on your Personal Space


Entry

A221482

Infinite Improbability Drive

Infinite Improbability Drive

Read a random Edited Entry


Written and Edited by

Disclaimer

h2g2 is created by h2g2's users, who are members of the public. The views expressed are theirs and unless specifically stated are not those of the Not Panicking Ltd. Unlike Edited Entries, Entries have not been checked by an Editor. If you consider any Entry to be in breach of the site's House Rules, please register a complaint. For any other comments, please visit the Feedback page.

Write an Entry

"The Hitchhiker's Guide to the Galaxy is a wholly remarkable book. It has been compiled and recompiled many times and under many different editorships. It contains contributions from countless numbers of travellers and researchers."

Write an entry
Read more