Breakpoints

The first in a series of beginner posts on debugging skills, this will introduce you to one of the most basic and fundamental debugging techniques – Breakpoints.

This won’t take long. Breakpoints are a simple concept but one that can elude new programmers for a while. I recall my early days in college when hearing about debugging with breakpoints seemed “advanced”. I know this is still a problem by my observations made from StackOverflow.com questions.

A program is a process and a debugger attaches to that process to provide debugging services. Modern integrated development environments (Visual Studio, Eclipse, Android Studio, Visual Studio Code, etc., etc.) can automatically run and attach a debugger to your program. If you have set a breakpoint, the code will pause execution on that line and wait for you to allow it to continue. While paused, there are a myriad of things you can do to interrogate the state of your program. Exactly what you can do depends on your IDE but all modern IDE’s support very similar capabilities.

Let’s look at a quick demo. I am using the built-in Chrome Developer Tools against a my demo site http://newup.consulting/dliyj/

I have chosen to demo a website because nearly everyone has Chrome and the Internet. Your language and environment will work very similarly to this process.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s