Intro to CS: Lecture 1 - Introduction


Here are my notes and thoughts about this lecture. Topics: Introduction to Python: knowledge, machines, objects, types, variables, bindings, IDEs.

Declarative vs. imperative knowledge. The former is statements of fact while the latter is a recipe or “how to”. In this course we will be dealing with mostly imperative knowledge. Programming is writing a recipe for a computer to do something.

We are really getting back to the basics. We talk about what an algorithm is, which is the following:

  1. A sequence of simple steps
  2. Flow of control process that specifies when each step is executed
  3. A means of determining when to stop

So I already knew (1) but I guess I didn’t consider (2) and (3) before, explicitly at least, so that’s something new.

Computers are machines that execute algorithms. Big idea: Computers will only do what you tell them to do.

Before there were fixed program computers, meaning computers with a fixed set of algorithms. Then came stored program computers. Now computers store and execute instructions. Key insight: programs are no different than other kinds of data. A special program called an interpreter executes each instruction in order.

This reminds me of when I took computer architecture, we were fetching instructions to execute from the registers, which were loaded from memory IIRC.

With primitives we build the syntax of a language. English for example, is made up of words as its primitives. The lecture draws parallels between English language and a programming language. Syntax validity is one example, another ex. Is static semantics.

Programs have multiple data objects. Objects have a type that defines the kinds of things programs can do to them.

This is all straightforward and I want to optimize for time, so I think I’ll only note stuff that I find interesting or haven’t learned before.

We review the basic primitive types such as int, boolean, float, etc. We review type casting and creating expressions. Note: Expressions are NOT stored in memory, only their result.

I guess something new I learned is that a function call is an expression because it results in a value.

Finished the video, it was all straightforward. I might even say it was a waste of time lol. But let’s carry on and see after the course just how much of it was redundant for me.