Learn creative coding writing simple programs

147. Let's make errors II (nullPointerException, arrays, logic)

This is one of those videos where we unfortunately don't do any amazing graphics. But we do something almost as fun: we provoke errors. I hope that by seeing errors happen you can identify them and fix them quickly when they happens to you.

In part II we take a look at nullPointeExceptions, which happen when you try to access a variable that has not been initialized. We also see what happens when you try to access array elements that do not exist, and finally we take a quick look at logic errors: programs with the correct syntax, but unexpected behavior.

This is really a quick overview, as there are lots of things that can go wrong in programs. Try to learn from your mistakes! :)

You can read about software bugs (and find out where the word comes from) in Wikipedia: https://en.wikipedia.org/wiki/Software_bug

Tags: bug, error, nullpointerexception, infiniteloop, array

Code editor

You can make changes to the code below. Then
Below you can ask and answer questions related to this video. If your question is unrelated to the video, please post it at the Processing Forum as I'm unable to help with all of your programs and still have enough free time to eat and sleep :)
comments powered by Disqus