The second half of the first week of CS50 – or rather, week 0 – is dedicated to computer thinking.
Now that we can communicate with the computer by turning on and off the switches (or more formally, speaking binary), we need something to say.
As stated at the start of this course: problem-solving is central to computer science / programming.
The example given ion CS50 is as follows: Try to find a person’s name in a phone book. Your options are:
- Read one page at a time, in order.
- Search two pages at a time.
- Randomly open the book until you achieve success…
- Start in the middle of the phone book and decide if the name is on the left or right. Continue to repeat the process, cutting the problem in half and half and half.
al·go·rithm /ˈalɡəˌriT͟Həm/ noun a process or set of rules to be followed in calculations or other problem-solving operations, especially by a computer.
Pseudocode; a human-readable version of code.
a.k.a. the building blocks to computer programming
- Before you create formal code, it allows you to think through the logic of your problem in advance.
- Others can understand how your decisions / how code works.
The official lexicon goes like this:
- Verbs (pick up, open, look at) = functions.
- Statements (if, else if) = conditionals.
- Expressions (true or false statements) = boolean expressions.
- When you catch yourself saying, “go back to…” = loops.
And now my first assignment:
Build (using the lexicon of elements) in Scratch.
For those new to it, Scratch is a wonderful resource built by the Lifelong Kindergarten Group at the MIT Media Lab as an educational tool to help children visualize programming. It’s target audience is between ages 8 – 16. And older Lifelong Kindergartens like myself.
On the site, Scratchers (i.e. me), can create projects using algorithmic logic.
Stay in touch, it’s in development 😉