Bugs and Errors
A bug produces unexpected results or causes a system to behave unexpectedly.
Last updated
A bug produces unexpected results or causes a system to behave unexpectedly.
Last updated
A bug refers to an error, fault, or flaw in any computer program or hardware system.
A bug produces unexpected results or causes a system to behave unexpectedly. In short, it is any behavior or results that a program or system gets but was not designed to do.
In the early days of computing, there were components that two pieces of metal had to touch to make the electricity go where it need to go.
Sometimes, the machines stopped working correctly, and when they investigated what was going on they found something wedged in between two of these pieces of metal that were supposed to touch each other.
IT WAS A LITERAL BUG! A moth to be precise had crawled inside the machine and had gotten itself wedged in between pieces of metal that were supposed to touch each other. Then they removed the bug, and hence the saying โThere was a bug in the computer.โ was created.
There are two main classes of computer bugs: hardware and software.
A hardware bug actually means that the computer is broken. This could be as serious as you turn the computer on, and it catches fire, or there is one byte in the RAM where one bit is not functioning correctly.
A software bug is basically an error in your code due to which you don't get the expected output. And debugging is the removal of errors in your code, to ensure you get the desired output.