Errors & Rubber Ducks
Errors & Rubber Ducks
Looking at Errors, Bugs,
& Rubber Ducking
Completed
Basics of p5.js
Mini-Project
Starting & Planning Interactive Fiction
Today
Errors, Bugs, & Rubber Ducks
Upcoming
Continue Semester Project
No Typing Today
Errors are common in programming.
We often call them bugs.
You've already run into errors here and there throughout the year.
You'll likely run into more as you work on your project.
Let's talk some about errors and bugs today.
The term bug comes from a bit of computer history.
There are a variety of ways that things can go wrong. This is true in life, and also true when creating things. It is, of course, also true in programming. There are a few different types of errors in programming, but the main two are Syntax Errors and Logic Errors.
We've seen and fixed errors quite a bit as we've moved through the semester... but we haven't specifically looked at or talked about errors...
Task:
On your slide for today, explain the different between a logic error and a syntax error.
Using p5js, demonstrate a logic error and a syntax error.
Label which is which.
Debugging is the term we typically use to talk about looking for and fixing errors in a program.
A common strategy used in debugging is called Rubber Ducky Debugging.
Can you think of a time where you asked for help...
... only to figure it out yourself before they could even help?
Today, you get to choose a duck.
You'll need to write it correctly.
We'll do this using the same way we refer to values in an array.
See the video below to learn a bit about arrays & javascript.
TASK Part 1
Using the video above, create an array containing multiple pieces of data.
Use the sort method to put it in alphabetical order.
Print all the content of the array using a for loop.
Add a screenshot of this on your slide for today.
See the video below related to choosing a duck.
TASK Part 2
Go to Mr. Wegscheid to choose your duck.
You'll be given a sticky note, and you'll have to refer to the duck using the method shown above.
After, take a photo of your duck using PhotoBooth. Give your duck a name.
On you slide for today, include the photo of your duck, and what you've named them.