Tuesday, February 26, 2013

Learning Computer Science: Analogies


Computer Science is abstract. It takes theoretical mathematics that are meant to be too pure to ever have an application, and then creates examples of them in cyberspace. What I'm trying to say is: it's hard to understand.
I can't tell you how many times in my years of tutoring I would be working with a brilliant math major or physics major (or biology or chemistry) that had helped me in many study sessions and have them give blank looks after we discussed a concept. So if you ever find yourself frustrated when trying to learn about computer science concepts, you're not alone. A lot of these concepts are frustrating to normal people.

A tool I often found was helpful to students trying to understand a concept was an analogy for an idea. Let's try one out.

An array is a sequential set of memory blocks that are allocated with enough space to store a single object of the type the array was defined for. By convention, elements in the array are indexed starting and zero and proceeding to index one less than the number of elements in the array.
Did you get that? Clear as mud, huh? Don't get me wrong, this definition is important, but let's add an analogy to it.

An array is like a bunch of iPhone boxes that have all been taped together end to end. They are all right next to each other, so if you put your finger on one, you find the next one by moving one to the right. They are all large enough to hold exactly one iPhone. Because everyone else does, we number them starting at zero, so the last one is numbered one less than the total number of iPhones.
Any clearer? It is to me at any rate.

Why should you care?

Computer Science is hard. To give anecdotal evidence, when I was a sophomore in college I started a Computer Science 2 course with about 30 students. Four weeks in all but maybe 11 had dropped the course and their major. The more tools you have to help you understand computer science concepts, the better off you’ll be in your studies.

No comments:

Post a Comment