UAL CCI: Introduction to Creative Computing Intensive 2022: 🔢 & 🐘: Lecture 2: Counting and Remembering.
Back to slide index.
By the end of this lecture, we'll have learnt about:
A pair of thoughts on how to help each other.

Austin's Butterfly: Building Excellence in Student Work from Russell Gordon

Getting rid of value words by Airea D. Matthews. I'd recommend you get two books to accompany this course: The Nature of Code and Code as Creative Medium. Why reading is important.
We are going to start this lecture series by learning about counting, specifically binary numbers, what they are and why computers use them.
Then we are going to learn about how computers remember information. Computers store this information in things called constants (if they never change) or variables (if they change). Constants are useful (for things like Pi or the number of days in a week), but we are going to use variables much more.
All that computers do is remember things by storing data (as constants or variables) and change those memories through commands. One thing they are very good at is remembering a number and then adding to it. If you want to read a great book on how computers work from the ground up, I recommend Code by Charles Pertzold.
One of my favourite pioneers in the world of computing is Grace Hopper. Here is a great video where she explains what a nanosecond is - in terms of distance travelled at the speed of light in that time. (BTW, the whole lecture is well worth watching). Amongst other things, Grace Hopper invented the compiler - which is how a computer turns a bunch of (human readable)code into a bunch of binary that it can understand natively. The same thing is going to happen to your p5.js code (or sketches) - when you press run on the p5.js online editor, the JavaScript code is translated into machine friendly forms, which are eventually run as binary on your own computer.
Now, finally, to counting. What is counting?
Counting is using groups of symbols to represent quantities or amounts. Let's count to 100 in Decimal. When do we need an extra digit?
Let's count to 10 in Unary.
Let's count to 20 in Binary. When do we need an extra digit?
What's the biggest number you can count to on your fingers in unary (or the way you were taught as a child)? What about in binary? What about if you use your fingers AND toes?
Tell the binary joke Joel!
I loved this visualisation of a mechanical binary counter:

How a mechanical binary counter works.pic.twitter.com/KI875l9VzD

— Universal Curiosity (@UniverCurious) December 10, 2020
Computers use binary to represent everything in memory. Why? Why is binary well suited to digital computers? This video has a good explanation.
Words for different quantities of binary numbers, that you might have heard of before:
Let's try out some JavaScript variables by going through the JavaScript basics page on the p5.js wiki, all the way up to the Math (sic) functions section. You are going to encounter "functions" while I go through the page - they are just ways of packaging up several commands in one bigger command - remember that computers only remember things and change those memories with commands.
All lines in JavaScript must finish with a ";" - it's just a way that the computer works out which line is which.
The two really important things I want you to remember from that is that you can use the "let" keyword to make new data (or variables) - e.g. let myName = "Joel"; and that you can do things with data using commands (or functions) - e.g. console.log(myName);, which prints out the value of myName ("Joel") to the JavaScript console.
Let's finish with two films about the scale of the universe and the scale of numbers.
Artwork: Powers of Ten by the Eames Office
A good example of a really really really really really big number is Graham's Number.

For more information, see this article on the fantastic Wait But Why.
Thanks! Time for a short break!
Back to slide index.