Classroom Programming
page was last updated: Oct 24, 2018 22:23
term list was last updated:
forum
sorry ): this page is incomplete. feel free to ask me directly for any help ^_^
Computers X2

I'm gonna put some basic info about computers that everyone should know about. This is the kind of stuff that if you call yourself a programmer and you don't know these things, people are going to slap a sticker on your back with bjAwYg==, or DEADBEEF. (reality: just snickers and dirty looks)

Ironically, the computer science major doesn't teach you anything this basic. I'll talk about CPU, RAM, Storage, binary, hex, internet, etc. I won't give a detailed explaination as you could write books for everything, but I will give a couple of sentances each.

Theres no particular order (yet) to these sections.

Binary

10111

CPU

The Central Processing Unit. Almost all code is executed here or at least passes through. Your program gets turned into binary by the compiler, the CPU eats this and spits out the result, and your program does something with the result. Your program lives in memory (RAM) while it is being executed and the results are there as well.

multicore / multithread

In ye olde days, 1 CPU = 1 Core = 1 Thread. Now we have CPUs with 32 cores, with 64 cores on the way. It's too much work to explain but here's a funny image you can work with. 1 cpu = 1 head. 1 core = 1 brain. 1 thread = 1 thought. So a 64 thread CPU means it can effectively process 64 thoughts/programs at a time.

You do not need a multicore/multithread cpu for multithreaded programs!!!! If someone tells you otherwise, make fun of them! Easy example, multithreaded PING program. I want to PING 100 computers but it takes time for the response to come back. In a single thread, I'd have to wait for a response or timeout before I can move onto the next address. In multithread, I can ping all of them immediately! Look at the network section for ping.

If you insist you need a multicore CPU, think about this. If you can only do one thread at once, how can you run your operating system and your games at the same time? ಠ_ಠ

CPU = brain. Runs your program.
Multithreaded application works on single-core CPU.

RAM

Random Access Memory is where we store data, such as variables or code, that we are currently working with. Stuff in here is volatile as in it's gone when you reboot the computer. We use this for data storage mostly because it's alot faster than putting on the disk (harddrive/solid state).

A location in ram has an address usually styled in hexadecimal format (0x1b3e3e7f). What address you get when you want to store memory is given to you by the operating system, who also makes sure you stay within the given addresses.

RAM = short-term memory for stuff we are working on now.

Storage

Storage is non-volatile. When the computer is off, we still keep the data. This is usually in the form of hardrive (HDD), solid state drives (SSD), flash memory, magnetic (tape/floppy), and optical (CD,DVD,Blu-Ray), not to mention other more exotic methods. The downside to storage is that it is SLOW. Measured in bytes.

Networking

Networking can be a really lengthy explaination so I can't cover too much here. We send data packets across the network using various protocols and addresses. Your data packet jsut gets bounced around on network through some smart routing and reaches the other end.

Maybe an example might be easier.

  1. Computer Alice wants to say "HI" to Computer Bob (some other city)
  2. "HI" message packed into a packet (FROM:Alice TO:Bob DATA:"HI")
  3. Alice gives this packet to the local network
  4. Home router sends to packet to outside router (your ISPs)
  5. ...The packet hits alot of routers...
  6. Packet goes to Bob's router
  7. Packet goes to Bob
  8. Bob decides if he wants it or not. If not, its "dropped" (on the floor, out of existance!)

The internet is really just a mess of routers connected. They ask eachother "who can give this to Bob" and keep passing it on until it reaches it's destination.

Data stuck into packets. Delivered via combination of UPS,FedEx,etc.

Latency vs Bandwidth

The time it takes to get there is called ping. This is usually measured in ms (milliseconds). How big the pipe is to send data is called bandwidth. This is measured in bits per second. NOT BYTES!!! (8 bits per byte). Storage is measured in bytes!

Usually when we talk about fast internet is TECHNICALLY wrong. This is because we talk about how long it takes to transfer a large file over the network rather than the actual delay. This matters when we care about delay such as games or communication. In these situations we care about when the small amount of data gets there relative to the real time.

My page on how websites work

Misc

Some general things that don't really fit anywhere. Sometimes just bugs me when people get this wrong.

Downloading vs Installing

ITS NOT THE SAME!!! I download music, I don't install it. I install programs, I may or may not have downloaded it from the internet.

Downloading is getting the data from somewhere and keeping it (usually from in internet). Installing is the process of registering and unpacking a program for use on a computer.