Quote

"For like a shaft, clear and cold, the thought pierced him that in the end the Shadow was only a small and passing thing: there was light and high beauty for ever beyond its reach." -- J.R.R. Tolkien

Friday, August 28, 2015

How Computers Work: A Desk Analogy

I am writing this for a coworker who needs to learn how computers and programming work quickly.

So here we go.

Computers are like desks.

They have workspace called "Random Access Memory" that is easily accessible by the worker seated at the desk (Central Processing Unit; CPU).

They also have file cabinets (Hard Disk Drive; HDD, or sometimes Solid State Drive; SSD) for longer term storage of information.

Some computers have lots of RAM and no hard drive space, like this desk:
Some computers have lots of hard drive space and no RAM, like this desk:


 Some computers are just awesome (like mine) and have lots of both, like this desk:

 And some computers are terrible and have very little of either, like this desk:

 Seriously, how can you work on a desk like that?

Modern CPUs are hyper-threaded and multi-cored.  This is similar to you having eight arms to do things with at once.  Like this lady:

Which is why all modern CPUs are both multi-cored and hyper-threaded.

Computer programs are like instruction manuals that tell the CPU how to generate/handle information.  Each line of code is a short instruction on what (specifically) to do with a piece of information.

Information typically is read from the harddrive in the form of a file and placed into programming objects in the RAM, like this:

 After the CPU does stuff to the information and puts it back on the hard drive in a file:


 So that it can be accessed later.

MS Windows is like that cranky old secretary who just won't die but is damned good at organizing and keeping all of your files available and ready to be used.

 When you give her a nice big desk with lots of file cabinets, she is much happier and works much faster.  And she tends to bite less this way.



No comments:

Post a Comment