What You'll Learn in This Hour:
No one writes perfect code. You're most certainly familiar with those problems that prevent code from executing properlythey're called bugs. Being new to Visual C#, your code will probably contain a fair number of bugs. As you gain proficiency, the number of bugs in your code will decrease but bugs will never disappear entirely. This book can't teach you how to debug every possible build or runtime error you might encounter; debugging is a skill and an art. In this hour, however, you will learn the basic skills necessary to trace and correct most bugs in your code. Before proceeding, create a new Windows Application project named Debugging Example. Next, follow these steps to build the project:
Your form should now look like the one shown in Figure 15.1. Figure 15.1. This simple interface will help you learn debugging techniques.
This little project is going to divide 100 by whatever is entered into the text box. As you write the code to accomplish this, various bugs will be introduced on purpose, and you'll learn to correct them. Save your project now by clicking the Save All button on the toolbar. |