DEV Community

Cover image for C - Debugging
Haile Melaku
Haile Melaku

Posted on • Edited on

C - Debugging

# What is debugging

A 'bug' is a metaphor for a glitch in your program that might crash or exploit your program on use.

Debugging is the practice of finding and fixing a bug in programs, software, or systems that prevents it from running correctly.

A common practice for debugging is printing data of the program to the console.

The term debugging was first coined by a woman named Admiral Grace Hopper. She found a Moth in the computer's relay which impeded operation. By removing it she said she 'debugged' the system, or something to that effect.


# What are some methods of debugging manually

Rubber Duck Debugging

Rubber Duck Debugging is a way of explaining you code and the process to rubber duck to find and fix a bug in the system.

There are only three simple steps to rubber ducking:

  • Assume your duck knows absolutely nothing about your problem. State the problem, how things are sitting at the moment, and what you are trying to accomplish instead.

  • Explain the flow of things. What happened? Go over every single step of the process without missing out on a single detail.

  • Arrive at a realization of the fix.

Tip: for more info on how to use rubber duck read this article


Top comments (0)