![A stick figure smiling](/images/welcome.jpg)
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!
![Image of a comic. To read the full HTML alt text, click "read the transcript".](/images/uploads/the-pocket-guide-to-debugging-wizard-zines-28.png)
read the transcript!
Some languages have an assert
keyword that you can use to crash the program if a condition fails. Assertions let you:
- come up with something that should ALWAYS be true
- immediately crash the program if it isn’t this variable is undefined!!!
Illustration of a program, represented by a box with an unhappy face.
program (thinking): “this variable is undefined!!! STOP EVERYTHING!”
This is a great way to force yourself to think about what’s ALWAYS true in your program, and check if you’re right.
Illustration of a smiling stick figure with curly hair.
person (thinking): “the radius can never be 0, right? or can it?”
Saturday Morning Comics!
Want another comic like this in your email every Saturday? Sign up here!