---
# System prepended metadata

title: '(Part I) Intro: Computers, Programming Languages & Programs'

---

# (Part I) Intro: Computers, Programming Languages & Programs

### Computers

<br />

![](https://i.imgur.com/kri5M0N.gif)


Computers are machines that help us do work. 

Tractors and jackhammers are also machines (they help us do work faster or with more ease than we could without them).

**What kinds or work do computers help us do?**

Computers help us do things really fast and accurately, they help us deal with large amounts of information (storing it, manipulating it).

In order to get a computer to help us do work we need a way to describe the work we need it to do.

### Programming Languages

<br />

![](https://i.imgur.com/2TiigT7.gif)

Programming languages are like spoken languages. They are all capable of more or less the same thing (for example, asking where the bathroom is), although some are known for being particularly good at different things (e.g. you might want to learn French if you're trying to impress a date, you might want to learn English if you want to rap along to Biggie tracks).

They all serve the same general purpose—they allow us to communicate with each other.


Programming languages are not too different. They help us communicate instructions to computers.

Without going too much into the details, computers understand binary (1s and 0s—we can also represent binary as yes/no, true/false, on/off). 

<br />

![](https://i.imgur.com/ln2yFwy.jpg)

<br />

To save us from having to write our instructions for our computers out as a bunch of 0s and 1s, we have programming languages which (with some massaging) can be both understood by computers and humans.

```
The binary code for Hello!:
01001000 01100101 01101100 01101100 01101111 00100001

The Python code for printing "Hello!":
print("Hello!")
```

### Computational Thinking

(See [pb&j exercise](https://www.youtube.com/watch?v=okkIyWhN0iQ))

A program is a set of instructions that describes how to do something (and running a program does the thing).

Computers will do *exactly* what you tell them to so you have to be exact and literal.

### Programming Language Building Blocks

Like spoken languages, we need to have a decent grasp of a language to communicate ideas/intructions/etc.

The more proficient we are in a language the more we can clearly and accurately communicate (increasingly complex) ideas (e.g. consider the things a two-year-old can communicate vs. a 22 year-old).

Instead of starting out trying to get two-year-olds (with no developed language skills) to write movie scripts, we start with the foundational building blocks of communication and build from there because it's difficult to communicate anything without knowing some language.

The same goes for programming languages.

Let start with the foundational elements of a language:

```
1. Data types 
2. Data structures
3. Comparison operators
4. Control flow
5. Functions
```

#### Data types

There are different types of data in the world that we need to represent in different ways.We're familiar with most of the data types used in programming languages from our everyday lives.

They have different rules and different properties. For example, we know 3 and 10 are of the same *data type* while "Jerry" is of a different data type (we can add 3 and 10 but not 3 and Jerry).

```
string (words)
boolean (true/false)
integer (whole numbers)
float (decimal numbers)
dictionary (mini tables)
```

#### Data structures

```
Arrays (lists)
Dictionaries
Tuples
Sets
```



