Video by freeCodeCamp.org · taught by David J. Malan · streamed from YouTube. All rights remain with the creator.
Lesson 1: Computational Thinking and Scratch
About this lesson
This first lecture of Harvard's introduction to computer science, taught by David J. Malan, explains what computer science is really about and lays the foundations for the rest of the course. It opens with the idea that computer science is problem solving, taking inputs and turning them into outputs, and asks how information can be represented at all. From counting on fingers, it introduces binary, the number system that uses only zeros and ones, and shows how the switches inside a computer can store numbers as bits and bytes. From there it builds up layer by layer: letters stored as numbers using the ASCII standard, the wider Unicode standard that also covers emoji, colours described by amounts of red, green and blue, and images, video and sound as long sequences of such numbers. The lecture then turns to algorithms, the step-by-step methods that solve problems, using the search for a name in a phone book to compare a slow method, a faster one and a dramatically faster one that halves the problem at every step, and showing how their running times grow as the problem gets bigger. You see how to write algorithms in pseudocode and meet the building blocks of nearly every program: functions, conditions, Boolean expressions and loops. The final part introduces Scratch, a visual programming language in which programs are assembled from blocks, with demonstrations of events, variables, loops and talking characters. Afterwards, read Chapter 1 of the course book, which works through binary and the phone book problem by hand.