Computers and Programming
Before you start to code, you need to understand how computers work.
- A computer is made up of many parts, each with their own purpose. We will look at the main parts and what they do.
Main parts of a computer:
Hard Disk Drive (HDD)/ Solid State Drive (SSD)
Random-access Memory (RAM)
Central Processing Unit (CPU)
Video / Graphics Card
The motherboard is what everything on your computer connects to.
It is a circuit board that lets other parts communicate and has ports facing the outside of the case for things like monitors, mice or keyboards to connect.
"XO-1 motherboard", by John A. Watlington, licensed under CC BY-SA 3.0
This is permanent memory storage where all your data is saved, even when your computer is off.
Hard disk drives are slower but cheaper. Solid state drives are faster but more expensive.
"HDD and SDD", by Santeri Viinamäki, licensed under CC BY-SA 4.0
Like the HDD or SSD, RAM stores data. However the RAM is only only temporary memory (known as volatile).
When you open a program, its data is stored in the RAM. When you close the program or turn off your machine, the RAM is freed so that other programs can use it.
More RAM means more programs you can run at once.
"Swissbit 2GB PC2-5300U-555 DDR2 RAM", by An-d, licensed under CC BY-SA 3.0
This is the brain of the computer. It does all the calculations needed to make computer programs work.
Different CPUs have different speeds. The faster the CPU, the faster your computer will run programs.
"Intel_CPU_Core_i7", by Eric Gaba, licensed under CC BY-SA 4.0
A dedicated unit for handling output of images to display. It has its own dedicated RAM for these functions.
The better the video card, the better you will be able to process video editing, rendering graphics, and high-end gaming.
Video Card, in the public domain
We can't turn on our computer without power. The power supply unit powers all other parts of the computer.
The power supply connects to either an internal battery or a plug for an outlet.
Power Supply, by Danrok, licensed under CC BY-SA 3.0
Image, by Ramesh_kannan5005, licensed under CC BY-SA 4.0
What is a programming language?
A programming language is a language designed to provide instructions to computers and create programs.
Different languages are better suited or designed for creating different types of programs.
Languages have different structures and syntaxes (how they are written).
"Top Programming Languages", by Daniel Iversen, licensed under CC BY 2.0
Integrated Development Environments (IDEs)
Where do we write code?
Programs are typically written in text editors or IDEs.
It's best to use IDEs as they provide useful tools for writing code, such as auto-complete, syntax highlighting, etc.
We will use python's Integrated DeveLopment Environment (IDLE), which comes as part of the python download.