To the uninitiated, debugging can seem somewhat like a black art. On the contrary, it's actually one of the best skills you can have as a developer—though it's rarely taught to novice coders, which I think is a tragic missed opportunity. All beginning coders make mistakes, and knowing about debugging enables you to find and correct those mistakes much faster than just staring at the code and hoping the bug will reveal itself.

By the end of this chapter, you'll understand the difference between a compile-time error and a runtime error, you'll know how to set breakpoints in your code, and you'll know how to step through the lines of your program one at a time to help you root out hard-to-find bugs.

Getting Started with Debugging ...

Get Introduction to Game Design, Prototyping, and Development: From Concept to Playable Game with Unity and C#, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.