ADVERTISEMENT
Google AdSense Slot (headerLeaderboard)

Set your Publisher ID in src/config/ads.ts to display live ads.

Introduction to Computer Programming• 6 min read

Debugging, Stack Traces & Error Handling

Read stack traces like a senior engineer, set debugger breakpoints, and prevent software crashes with try/catch exception handling.

The Three Categories of Software Bugs

1Syntax Errors: Grammar mistakes that prevent the code from compiling or parsing (e.g. missing brackets).
2Runtime Errors: Crashes that occur while the program is executing (e.g. division by zero, null pointer dereference).
3Logic Errors: The code runs without crashing, but outputs mathematically or logically incorrect results.
ADVERTISEMENT
Google AdSense Slot (inContentBanner)

Set your Publisher ID in src/config/ads.ts to display live ads.

Test Yourself With Exercise

+15 XP

Which block captures runtime exceptions and prevents programs from crashing unexpectedly?