Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

So, I'm a computer science major and I'm also a huge fan of the no-longer-on-TV show, Numb3rs.

Now, whenever I talk with my friends they also ask me quite a few questions about programming and computers (and how they work). Now, on Numb3rs, they (Charlie, and occasionally Amita or Larry) often went on short, but well explained and well spoken summaries of the mathematical topic. While they had the benefits of graphics, often their voices alone were plenty to explain. Basically, they took complex concepts and presented them in laymens terms. It was short, concise, easy to understand, and very interesting.

Basically, I'm looking for something like that. Just a really great, short, interesting analogy for computer memory. So, thanks to whoever can come up with a brief, interesting, engaging, enjoyable, but educational and correct analogy/summary for computer memory!

share|improve this question

closed as not constructive by Mark Trapp Dec 4 '11 at 5:23

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
First, you must come up with an algorithm to solve a crime. –  jonsca Dec 4 '11 at 3:51
    
@jonsca Very true. Got any of those? :P –  Bob Dec 4 '11 at 3:52
    
Hi Bob, this is a site for professional questions about software development: while there might be a good question in here about explaining a specific programming concept to a layperson (like say, a boss), I'm afraid coming up with a list of analogies for explaining how memory works to your friends is outside the scope of the type of questions that work well here. If you're interested in revising your question to fit our site's scope better, take a look at our FAQ and consider focusing your question on a specific question about software development. –  user8 Dec 4 '11 at 5:26

3 Answers 3

up vote 1 down vote accepted

Computer memory reminds me of Post Office Boxes a lot:

  • Each box can store an item.
  • Every box can be identified and accessed discretely using its unique address.
  • One can place an item into the box or remove an item from the box, or just simply peek inside to see what is stored there.
  • All boxes are standard size, they're interchangeable, the only unique thing about them is the address. Adding extra capacity means adding more shelving units.
  • In some cases an owner can access the box directly, but sometimes only via a member of staff (managed memory).

Where the metaphor breaks down:

  • P.O.B. can contain more than one item.
  • When memory is read the stored value is not consumed, whereas taking a letter out of the P.O.B leaves it empty.
  • Memory at an address neither full nor empty, it always contains a value.
  • Storing a larger parcel would mean splitting it across multiple adjoining boxes. Perhaps this could be explained using the analogy of removing partitions between adjoining P.O. boxes with the parcel taking up multiple addresses.
share|improve this answer
    
Alright, this definitely wins as the best one (out of the ones I've seen). It was exactly on topic, it explains memory well enough for people to visualize it, but is still educational. Very good! –  Bob Dec 4 '11 at 5:26

Computer memory works just like writing on paper in pencil- you go back and read it later, or erase it and write something new. There's just an awful lot of paper, read and written in obscene times.

share|improve this answer

I like to think of it as a giant wall of numbered Safe Deposit Boxes like at a Bank and every Box contains a piece of paper with a number on it.

It works to describe lots of circumstances. How do you explain what the ASCII characters 'A' and 'B' are? Everybody just agrees that a piece of paper with the number 65 means 'A' and 66 means 'B'. The same thing goes for encoding pictures/movies anything.

How do we store bigger things like the String "AB". We need 2 boxes. One to store 65 and one to store 66. It would make sense for these boxes to be next to eachother. Maybe the 'A' gets stored in box number 1000 and then 'B' gets stored in box 1001. How do we know that the String only has 2 characters in it? Maybe we store the number 0 in box 1002 to signal that that's the end of the String and it turns out that this way actually needs 3 boxes to store 2 characters.

Are there other ways I could store the String? How do I know how long the String [65, 66, 0] is? I have to start at box 1000 and keep opening boxes until I get to one with 0 in it. Is there another way I could store my String? What if the first box held the length of my String? I could store [2 65 66] and then if I need to know the length of my String I only need to open the first box. As long as me and everybody else knows what system I'm using it doesn't really matter which way I choose.

How do we know where our String is? We somehow need to know it starts in spot 1000. Either we wrote it in our code or we somehow have access to another box (a pointer) and inside that box on its piece of paper we write 1000 so that we know our String starts at location 1000.

Maybe you think it's stupid that 65 means 'A'. You could say 1 = 'A' and 2 = 'B' etc. That system is perfectly fine too as long as when you share them with other people those people know what your system is.

We could keep going deeper and deeper but eventually we will have to come to the realization that the significance of what is written on the pieces of paper are whatever we as humans decide is the significance. We the programers decide whether a number in a box is an Integer, Fraction, Character, Pointer to another box, Instruction for the Machine, Pixel color for an Image. Only the people who wrote the numbers on the paper can figure out whether 65 means 65, 'A', -99, Red, Infinity or an Orange Bucket.

It is like writing. What is the significance of a vertical line? Is it a lower case L? Is it the number 1? Is it part of some sort of drawing? Does it stand for a word in another language? Is it that thing above \ on my keyboard? The only way you can know the meaning of the line is if the person who drew it tells you.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.