Day 9: Learn To Use Your Debugger
Hi, this is the 9th part of a series of posts on 30 tips to becoming a better developer. If you would like to keep up to date with the topics that I am covering, just check the main post.
Debugging is one of the parts of the entire process of writing software that is time consuming and repetitive. While coding an algorithm can take a few minutes, debugging a problem found in an existing program can take anywhere from a few minutes to several hours of concerted effort.
However, despite the fact that we usually need to spend lots of time tracking down problems that show up in our code, it is interesting to see how few developers have familiarity with the facilities provided by their debuggers.
The most probable cause for this kind of overlook is that developers don’t see the activity of debugging in good sights, and with a reason. Spending too much time on debugging generally means that you didn’t spent enough time on the planning and design phases. It may also mean that you have been sloppy during writing and testing.
Still, there is no way to avoid the fact that humans make mistakes, and that these mistakes need to be fixed in some way. If we are talking about software, this means trying to find where the problem is happening and then finding a reasonable fix to the root cause of the problem.
Unless you are on the league of developers that don’t use anything else other than printf’s to debug code (I think Linus Torvalds is on this list), you need a debugger. So, you need to start looking at the debugger not as an evil that you should avoid, but as a tool that you can use on the right situations.
Other Uses for a Debugger
Once you get used to your debugger, you will start finding some uses for it that are not just related to finding and killing an existing bug. For example, a practice that many productive developers have is using the debugger as a first pass testing tool.
This method is not enough to replace serious testing, such as writing unit tests for all your code, but it is usually good enough to let you know if your “first draft” of code is working or not.
The idea is that, for each new method you write, you should put a breakpoint at the beginning of the method. Then, let the program run until the break point is reached. The next thing is to follow the execution of that part of the code step by step, until you are convinced that the results are correct.
Using the step-through method with each new method you write is a good practice, because it will give you more confidence on what you wrote. It is not a formal procedure like writing a unit test. But even if you are writing such tests it is still useful to use the step-through method. For example, while going through the code you could think of new tests that should be added to catch some extra cases that you didn’t consider initially.
A Debugger as a Poor Man’s Dynamic Language
The main reason why using a debugger can be very useful if you learn it well is that debuggers allow you to poke at the program as it is running, as opposed to just look at a listing of code. Even in a static language like C++, you still have a lot of freedom while using a debugger. You can, for example, change the contents of variables at will, and even modify the contents of specific memory areas.
The result is that the debugger can provide you with a dynamic view of how the code is working. For example, it is extremely easy to see the stack of callers that brought you to some point in the code. In an OO program, this can be a very useful information that is sometimes hard to find by just looking at the printed code.
Finding More Information
There is a huge amount of information about debuggers in their own documentation. You just need to take the time and learn what is available. Here are some links that will be helpful if you are using Visual Studio, gdb, or ddd.
You should also check Code Complete, which has a nice section on the marvels of debugging!
Go to the next post of the series:
- Day 9: Learn to Use Your Debugger
- Day 10: Learn Keyboard Shortcuts
- Day 11: Understand the Lower Layers of the System
I highly recommend the book Debugging (nine rules), that demonstrates this topic in great depth with lots of real-life examples.
Hi Satai, thanks for the comment, I didn’t know about this book.
Du nöchtest wissen, wie man sofort einen gratis Willkommenbonus mit Startguthaben erhält?
LevelUp Casino – Exklusive Freispiele ohne Einzahlung,
nur für neue Spieler! Viele Casinos bieten nach dem No Deposit Bonus großzügige Einzahlungsboni an. Du erhältst dann nach Abschluss der Registrierung
eine festgelegte Summe Bonusgeld, die Du frei oder mit kleinen Beschränkungen im Online
Casino einlösen kannst.
Viele Casinos ermöglichen es dir, hiermit zu spielen und echtes Geld zu gewinnen. Du kannst mit 50 kostenlosen Freispielen viel Spaß
haben und, wenn das Glück dir hold ist, einen attraktiven Echtgeld-Gewinn erzielen. Glücksspielanbieter, die Freispiele ohne Einzahlung zur Verfügung stellen, haben meist mindestens noch einen Einzahlungsbonus zusätzlich im Programm.
Sie erhalten sozusagen die Möglichkeit, ganz
ohne Risiko zu spielen und Gewinne zu generieren, die
Sie sich auszahlen lassen können.
References:
https://online-spielhallen.de/robocat-casino-aktionscode-alles-was-sie-wissen-mussen/
Each of their releases offers realism and excitement.
It offers a mobile-focused, regulated, and innovative multi-product portfolio.
This catalog’s foundation is made up of numerous top-notch casino software providers.
In this game, you can choose to wager in numbers or
colors. Spoiler alert, avoid placing a “tie” bet if you want to win this game.
Since the 19th century, the French elite have enjoyed playing baccarat.
This step is crucial for preventing fraud, money laundering, and ensuring that players are of legal
gambling age. We ensure that each casino offers tools like deposit limits,
self-exclusion options, and links to gambling support organisations.
We dive deep into the game libraries to check if there’s something for everyone, from pokies and table games to live dealer options.
At Sun Vegas Casino, you will only find online casino sites
with fair terms and conditions, regardless of their popularity.
These are the best Australian online casino sites backed by our experts.
References:
https://blackcoin.co/no-deposit-free-spins-bonuses-2025/
You can use our expert tips to find the best casino, such as exploring the game lobby, checking the software providers, reading the bonus terms,
and talking to customer support. My research and testing show
that DragonSlots is currently the most well-rounded online casino in Australia.
Its tropical setting adds a unique vibe while you explore over 500
gaming machines and a variety of table games. If you’re someone who likes playing on your phone, you might find
it annoying that there are no native apps for AU casinos.
“Playing from anywhere at any time” might be a bit much
when we’re talking about casino games, but I cannot deny the convenience.
The platform features a wide selection of pokies with diverse themes and engaging mechanics, alongside classic table games like blackjack and roulette.
Casinority is an independent review site in the online casino niche.
Yet, it may differ from what you find on casinos’
sites when T&Cs change unilaterally. There are a lot of articles and pages related to Australian casinos and gambling on Casinority.
The Australian legal framework that regulates online gambling is quite complicated, which is reflected in the legal status of this form
of entertainment. With thousands of gambling sites targeting the
Australian market, it’s not an easy task to pick
the best ones. With a background in creative
writing and digital media, she offers a clear, player-focused
view on all topics. She has loved casinos for a long time.
Choose platforms that prioritize player well-being and offer tools to help you stay in control.
Knowing the difference helps you stay in control, gamble
responsibly, and enjoy gaming for what it really is — entertainment.
References:
https://blackcoin.co/winx96-casino-in-australia-real-money-gaming-fun/
paypal casinos online that accept
References:
dubicly.com
paypal casinos for usa players
References:
empleosrapidos.com