23

I have been taking Advanced Placement Computer Science for this past year in high school. It seems as though we are taught simply to memorize code and functions and not how to be resourceful and efficient in using documentation and the like.

Practically, I imagine many (if not all) programming jobs would allow you to flip through documentation, review past code and the code of others, essentially doing what my teacher would consider "cheating."

While I do agree core concepts are essential to memorize (in any subject matter), it seems superfluous and impractical to me to give a pen-and-paper exam for a CS class, especially when practically you would have a compiler, debugger, reference manuals, and the entire internet to refer to in any real-world work situation.

Why is CS taught focusing on the memorization of code and functions as opposed to teaching useful skills including how to use and interpret documentation, sample code, the debugger and such?

15
  • 34
    CS is not about memorization of code and functions. Where the hell are you studying CS? May I suggest the real problem is that the course you're taking is crap?
    – Andres F.
    Feb 8, 2012 at 1:41
  • 1
    @AndresF. OP is in Advanced Placement Computer Science which is a course offered to high schoolers (before university).
    – user7007
    Feb 8, 2012 at 1:49
  • 3
    @GlennNelson Oops! I misread that. Ok, in that case: esqew: you'll be relieved to know, at a university level, CS is (mostly) not about memorization of code. You'll have to read lots of stuff, though ;) A CS education is also not necessarily about finding a job (you'll probably be disappointed if you think it is)
    – Andres F.
    Feb 8, 2012 at 1:56
  • 1
    You should know it is not this way at most colleges. At my school, every single computer science test has been open notes/open book. Feb 8, 2012 at 3:00
  • 2
    Note that part of the answer most likely is that CS is not a programming degree. Don't expect to learn programming from a CS class. Expect to learn all sorts of underlying theory and concepts which just so happen to be relevant to a programmer. And sure, you'll learn a few programming languages and be taught a bit of basic programming, but mainly, the actual programming is something they assume you'll get so that you can focus on all the CS stuff, and not the other way around.
    – jalf
    Feb 8, 2012 at 12:35

7 Answers 7

37

In a high school class, you're in the most basic level of your path to mastery. Things that are covered in your class are the kind of things that a professional programmer are expected to know cold. In a lot of ways, this is akin to learning your "times tables". Of course you'll always be able to grab a calculator in a "real-world" setting, but this memorization not only increases your speed in more complex tasks, but also promotes a more thorough understanding of the basic principles.

For example, you should know several sorting algorithms, how they're implemented, how they work, when they're best used, and when not to use them. This could always be looked up, but shouldn't have to be - anymore than a mathematician should have to look up 6 times 8.

11
  • 9
    You should know the basic nature of the sorting algorithms but it's been about 15 years since I had occasion to write anything other than a bubble sort. (For very small N it's sometimes the better answer.) Feb 8, 2012 at 1:39
  • 1
    I wish I could say that all Computer Science classes are that good. At my high school they taught basic syntax of java... For the entire year. Many of the class left boasting of being "a programmer" when they couldn't even explain the difference between Bubble sort and Dijkstra's algorithm. Feb 8, 2012 at 4:28
  • 2
    As an example, given that you can look up any word in a dictionary, theoretically you should be able to understand this article on meantone. But our brains only handle a limited number of nested incomprehensions.
    – Benjol
    Feb 8, 2012 at 9:53
  • 1
    And surprise- memorizing my times tables has been of absolutely no use to me whatsoever. How much time does the average software engineer spend implementing sorting algorithms? Oh wait- probably about 0. Even on the extremely remote off-chance that the environment-provided sort isn't good enough for you, you only need one guy to write a more appropriate algorithm- and he can use the trivially available information on something like Wikipedia to select and implement the optimal algorithm- and then you can re-use it for the rest of time.
    – DeadMG
    Feb 8, 2012 at 12:23
  • 2
    @kaoD: And memorizing the reference is not going to help with that one little bit. It doesn't involve devising anything, it's just a copy paste. The only difference between answering from memory and copy-pasting from Wikipedia is that one is stored in RAM and one is stored in your brain. It's still a copy-paste.
    – DeadMG
    Feb 8, 2012 at 13:06
14

It is often taught this way because teachers generally don't know any other way of testing understanding. Your feelings are completely correct in that it is worthless to be taught like this. The way people are educated in general is in need for reform desperately!

Life gets better though, at least at UIUC I have found that the higher you go in your CS classes the less the exams are oriented as you are describing and in the majority of my courses we have been allowed a cheat sheet for the all the crap that you would likely have googled if you were actually sitting at a computer.

That being said, the higher up I have gone in my classes the less they actually teach you about languages or how to implement something. In fact I have only had one class where they have actually taught us anything about programming, it's mostly been abstract mathematical concepts and we have been expected to just figure out the programming part on our own (provided they were always happy to help but this was never something on an exam).

3
  • 2
    +1 Amen. I used to teach programming at the college level, and my goal was to move students as quickly as possible to the point where they could do their own unique projects. I hate it when teachers treat it as memorizing or doing things the "right way". What I tried to do was put enough skills in place to unleash the students' own creativity. Feb 8, 2012 at 3:02
  • ... I had students who were very smart and very good at memorizing. It would take them one or two tests before I could convey that you need to write programs to learn programming, not memorize stuff. Feb 8, 2012 at 3:07
  • Hear hear! It's funny, growing up I was never good in school; bad ACT score, bad grades, etc. But upon being introduced to CS everything just made sense. I definitely struggle in certain areas but I've only learned to overcome the things that have held me back through understanding concepts I have learned in my CS classes.
    – rudolph9
    Feb 8, 2012 at 3:28
10

Don't let schooling interfere with your education.

-- Mark Twain

I'm a mexican and telling you this because in Mexico is not exactly a good place for education (in any level), at least in public education.

Well, at the middle of my career (CS) I feel exact the same way you're feeling, so I start learning by my own and I spend one year learning algorithms, linux, scripting, how my computer works, a bit of relational databases, html, css, etc (a little about all). And of course, I had to skip classes*, let my grades down* and graduate one year after*, all in order to learn.

After that year, I return to my "normal" routine, back to regular classes, homework, exams and projects. The classes were still boring, nothing new to learn, all was the same. So I decided to enter to programming contest sites like UVA judge online, code chef and project euler, then I watched some lectures at the MIT Open Course Ware and I was still learning by own, but in a different way.

The lesson: Don't let the things happen, make the things happen. If you're not happy with the way you're learning, change It!

*Not the wisest decisions that I have made.

2
  • 4
    "Don't let the things happen, make the things happen", - If ever there were words to live by, its those! Feb 8, 2012 at 7:29
  • +1 for the quote. I <almost> didn't have to read the rest of the answer
    – Chani
    Feb 8, 2012 at 11:59
3

It depends on what you are trying to memorize...

In order to study math, for example, you have to be familiar with algebra and you frequently have to be rather creative in how you go about performing algebraic manipulations in order to simplify equations. But you have to have memorized certain building blocks in order to be able to focus on those interesting bits. You have to, for example, know your multiplication tables by heart and you have to know some identities so that you can recognize how to manipulate the equations in order to use those identities.

In order to study computer science, you similarly need to be familiar with basic building block data structures and algorithms because you're going to need to apply them to higher level problems. It's highly unlikely that you'd ever, for example, write your own linked list implementation in the real world, you'd simply use the one provided by your library. But knowing how a linked list is implemented and how to implement your own, you'd be able to reason about where and whether to use a linked list when you start working on higher-level problems. Similarly, you'd never write your own binary search function but it's important to understand how it works so that you can reason about things like where a database could use an index and where it couldn't.

Once you have some basic building blocks memorized, it's much easier to do things like interpret documentation. Documentation might indicate that a list is being used and assume that the programmer implicitly knows that this means that inserts are O(1) and searches are O(n). The building blocks are also vastly more stable over time-- you're very likely to use new debuggers every few years, you're likely to use the same binary search your entire career.

1
  • Where and whether to use a linked list is based on things like it's complexities for various operations, and it's memory performance. You don't need to implement one to know either of those things. Where can a database use a binary search? For keys which it knows how to compare. Well, that was easy.
    – DeadMG
    Feb 8, 2012 at 13:16
3

"Why is CS taught focusing on the memorization ... as opposed to teaching useful skills" - I think you are discounting memorization a bit too much. Just as you should practice writing code, interpreting documentation, using debugger, you should also practice memorization.

You may be surprised how much more efficient you can become if you don't have to go to API reference as often or look up as many debugger commands.

One of the best things I learned in highschool was by observing a friend who never took any notes in class. His argument was that he could remember what's important. I started doing the same thing and do think that it improved my memorization skills which I find very useful on daily basis even with all those API references handily available.

3
  • 2
    Not having to look up the API comes through practice, not teaching the API as formal education.
    – DeadMG
    Feb 8, 2012 at 12:36
  • @DeadMG: Being able to remember more things comes with practice, just like everything else. Requiring you to remember certain APIs is not a goal in itself, but a means to train your head to retain information so you don't have to look it up as often. And I'm not talking just about APIs, if I can remember one extra thing, that's one less trip I need to make to Google/MSDN/another source file and with practice this does make a difference in how fast you are able to work.
    – DXM
    Feb 8, 2012 at 20:01
  • Practice with that specific API. Not memorizing things in general. And the time spent in education is a tiny footnote compared to the professional time.
    – DeadMG
    Feb 8, 2012 at 21:22
2

Pen and paper exams actually do make sense if the goal is to test a complete understanding of the subject at hand. I did take the Computer Science AB exam almost a decade ago and I agree with the pen and paper method.

You should know enough of any algorithm you learn in the lower levels of Computer Science to be able to reason out how to write the implementation code in your target language. Students should also be able to write code by hand with mostly correct syntax. We all miss a semicolon or parenthesis sometimes :). Also debugging and design skills can be tested without inference from a helpful IDE.

If a student cannot do this, then they do not possess mastery of that topic, just perhaps a passing familiarity.

3
  • -1 : All hand writing syntactically correct code tells you that the person is capable of writing a compilable a program (Probably about a million times slower than the slowest computer)-that may not work as intended. Worse, they just have a good memory and can probably recite Shakespare if asked. It goes little way to indicating the skill of the person as a developer.
    – mattnz
    Feb 8, 2012 at 3:54
  • This answer presents no reasoning for the opinion presented. Why should anyone be able to write an implementation for any sort algorithm in their favourite language?
    – DeadMG
    Feb 8, 2012 at 12:27
  • The point isn't that this person is a good developer, it is that they know the Computer Science material taught in their class. If a student has been taught how to graph a function, then its reasonable to expect that student to do so on an exam. Good tests also beat memorization by asking questions that require conceptual understanding such as implement bubble sort using multiple keys for this data structure I just pulled out of thin air, or explain the difference between this searching psuedocode I give you and binary search. Feb 8, 2012 at 16:16
-2

In my experience, memorization comes with simple practice and there's absolutely no need to teach it at all. More importantly, this approach means only memorizing what you actually need to remember in whatever you're doing, not a bunch of random junk that your teacher hopes you might need and invariably you won't. The time spent memorizing the implementation of some algorithm could be much better devoted to some other cause.

After all, why would you ever need to practice writing an algorithm? Once you write it once, you can re-use it for all time- even on the exceedingly remote chance that someone else hasn't already written a freely available implementation for the language of your choice and that your environment doesn't already provide such an algorithm for your use, which is trivially not true for the vast majority of simple algorithms like sorting and such. Practicing something where it's highly unlikely that you'll ever have to do it in the first place and even if you do you'll only ever have to do it once? Not a valuable use of time.

The important thing to know about Heapsort is not how to implement it at all. It's the operating complexity in best and worst cases, and similar things. But, surprise, there's a handy-dandy table on Wikipedia that will instantly give you this information. So again, there's no value in having that knowledge. It's instantly available for you whenever you want it from now until the end of time at effectively no cost. So why would you want to memorize it? It's pointless.

In my experience, there is absolutely no reason to require a student to memorize anything. If you're asking a question which can be answered from a reference source, then you're asking a question where being able to answer it has no value.

5
  • 2
    Gee, guys, don't bother explaining your downvotes or anything like that....
    – DeadMG
    Feb 8, 2012 at 12:52
  • The only time I needed to know heapsort was when I needed a modifiable priority queue (heapsort works great as a priority queue). Being able to adapt known algorithms is a good reason to know how to implement them. Feb 8, 2012 at 15:09
  • @David: You don't need to know how heapsort works. An implementation using any sort algorithm would be fine.
    – DeadMG
    Feb 8, 2012 at 15:24
  • Not in that particular case, it wouldn't. It had to handle lots of events, frequently, on a system that already might be overstressed. For that project, we needed efficiency, and we got it. For context, that happened once in a rather long career, and all of my sorting for a long time has been things like SQL's ORDER BY and C++'s std::sort family. Feb 8, 2012 at 15:50
  • @David: Hence, I'd suggest that it's hardly something that every programmer needs.
    – DeadMG
    Feb 8, 2012 at 16:17

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