Here's a preview from my zine, The Pocket Guide to Debugging! If you want to see more comics like this, sign up for my saturday comics newsletter or browse more comics!
read the transcript!
Commenting out code is an amazing way to quickly do experiments and figure out which part of your code is to blame. You can:
- comment out a function call and replace it with a hardcoded value, to check if the function call is broken
- if the error message doesn’t give you a line number, comment out huge chunks of the program until the problem goes away
- comment out some code and rewrite it to see if the new version is better
Saturday Morning Comics!
Want another comic like this in your email every Saturday? Sign up here!
© Julia Evans 2024 | All rights reserved (see the FAQ for notes about licensing)