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.

I'm talking about knowing an area of computer science or a language, and then forgetting it over the years. As I approach the 20 year mark, I'm finding myself realizing that I've forgotten more than I currently know. Is this bad? Is this good? Is there a way to solve this? And if not, which things are worth memorizing?

For instance, we all know (I think) that Quicksort provides O(n*log n) in average cases, and we know it can balloon to O(N^2) when fed with the wrong inputs. How many of us, if asked without notice, could write a functioning Quicksort on the whiteboard or in their code editor of choice, without blinking? Is this useful? And if we can do it, does it count if it's a naive implementation, and not the optimized version that was engineered by Bentley & Company?

I give that as an example, but it could be anything. C++ has many dark corners, that if not used for some length of time, can be easily forgotten. And let's face it, there are many dark corners in C++ that one prefers to steer clear of.

share|improve this question
1  
um...what was the question? –  Steven A. Lowe Jul 30 '11 at 23:39
add comment

9 Answers

up vote 13 down vote accepted

Einstein, when asked for his phone number, went to a phone book to look it up. When asked why he didn't know his own phone number, he said "I never bother memorising things that I can look up"

I've forgotten a lot about a lot. Google remembers, so I don't have to.

share|improve this answer
1  
+1 For the sheer simplicity of the solution. –  Cape Cod Gunny Dec 2 '10 at 22:48
    
Yeah, but as neurolinguist Steven Pinker pointed out, "Google doesn't think." To find something on google, you have to at least have a vague awareness that the thing exist and relates to what you're doing. Having said that, you're probably talking about remembering details which can be looked up as long as you remember generalities e.g. to look up a phone#, you have to remember the person's name. Names are general and static, phone# change, at least they did in Einsteins day. Analog, don't you know. –  TechZen Jul 7 at 16:58
    
google doesn't think...yet ;) theguardian.com/technology/2014/feb/22/… –  Steven A. Lowe Jul 8 at 19:10
add comment

Unless you are talking about answering questions on SO, then I think all that is really useful is what is technologically current. And currently, I don't think more than a handful of programmers (who are probably professors or developers for a fairly low-level language) are really concerned with needing to know the Quicksort algorithm by heart.

I think we all tend to forget most of what we have learned, largely because most if it is actually unimportant.

I wouldn't really make a point of purposely memorizing something that I'm worried about forgetting, since most of what is right at the forefront of my mind is there due to necessity — I can quickly recall what I really need, since needing it often is why it is there.

There will be a few important things that you will forget, but I think that's what's brilliant about the way memory works. We simply need the right trigger — such as a little research to remember the basics — and it will all come flooding back.

share|improve this answer
2  
When jumping into a long-forgetting area the first time after several years of disuse, start slowly, and wait for the old memory to be reloaded one-by-one. It's like starting up a computer. –  rwong Dec 2 '10 at 6:20
add comment

You will forget over the years what you don't use. It's normal. It's how our brain works.

Maybe an analogy with the garbage collector will make it clearer.

  • What you're currently engaged into the mind will keep in your memory for as long as you have references to those knowledge variables (you use them in practice)
  • What knowledge you don't use any more will be promoted to growing generations of the garbage collector. The farther away (the generation is higher) the longer and harder will it be to retrieve this knowledge, to reload it into memory.
  • The oldest knowledge will get disposed by the garbage collector. In fact, it will likely be persisted somewhere in the back corner of your brain, but you won't be able to address it (without certain meditation techniques or something).

What you can do to keep on to knowledge? Nothing except preventing it from getting promoted in the generations of the garbage collector by referencing it regularly. Meaning using it periodically. If you don't, you'll lose it eventually.

  • Should you be worried about it?
  • No. It's natural and it's not your fault. Nothing you can do. There are other things in life that deserve worrying about.
share|improve this answer
    
+1 - GC analogy for the win. –  ChaosPandion Dec 2 '10 at 7:33
    
Awesome answer. I like the metaphor. –  Jim G. Dec 2 '10 at 18:24
add comment

Don't worry; most students can't even write a functioning Quicksort. And besides, C gives you qsort() for a reason!

If you are good enough at the basics, concentrate on continuing education, like picking-up a new language or tool, reading blogs and magazines, trying different application domains, etc. That will build on your current knowledge base and make you better in the long run.

share|improve this answer
    
I think you could make a stronger argument that remembering how to write a quick sort is a waste of space than a good use of it. Outside of theory courses you're almost never going to be asked to do so as there are libraries for that. –  Jon Hopkins Dec 2 '10 at 17:10
    
Never mind students: many fine developers have "optimised" Quicksort and made it slower on average - quite a few have broken it too. –  MarkJ Dec 3 '10 at 0:03
add comment

In the case of Quicksort, I think the relevant data would be to know whether a sorting method that you are calling implements quicksort, and if so, is there a chance that your data will be sorted when it is called. This is probably true of most algorithms: if you need to implement something that you vaguely remember, you can probably find pseudo-code and work from there.

From my perspective, the real issue is knowing how hard the problem you are dealing with is. If a client wants you to design a perfect algorithm to find optimal driving routes between locations (as a Real Estate agent once asked me to do), it's helpful to know that this is probably impossible with any useful number of locations... and to know you need to refresh your knowledge on the Traveling Salesman problem to come up with a good solution.

Its probably also good to be able to recognize when you might want to apply an approach, like divide-and-conquer or dynamic programming, to a particular problem. I don't know how much fundamental algorithm design most jobs take, but these are good general techniques.

From automata, it's probably good to know when a problem you are looking at literally cannot possibly be solved with a regex (say, parentheses matching) and when it can, or when a simple stack machine might provide an elegant solution.

But that doesn't mean you have to be able to write one from scratch, it just means that you recognize how hard the problem is.

share|improve this answer
    
+1 for the key point: remember principles; you can always look up the details if needed. –  Larry Coleman Dec 2 '10 at 13:57
add comment

I wouldn't worry about it as long as you still remember how to learn. Or at least remember where you can go to re-learn what you've forgotten.

For example, rather then memorizing mathematical formulas, I find it much better to memorize where to find mathematical formulas. It is easier for me to remember, and it is probably kept updated while my memory may not be.

Providing that I at one point understood the material, a simple refresher is all that is needed to start remembering the stuff I had forgotten.

share|improve this answer
add comment

I could write quicksort, because I'm pretty good in memorizing algorithms, but there are countless other things I've forgotten. Sometimes, I look at old source code and ask myself: Was this really me who wrote this? I think I've forgotten more programming languages than I still know.

share|improve this answer
add comment

Isn't that the life? I for example have forgotten BASIC, COBOL, FORTRAN, and even JAVA. I also forgot compiler (LR parser, RR parser), computer architecture (MPP, latency, disk cache), 8085 processor to name a few. And I don't worry about this. Currently I work in C++ and I know most of the things that needed for my day to day life.
I can understand you worries about this. The worry I feel you have is what all to keep in head and keep in touch with and what things to forget. I will advise that don't worry about this. The actual thing is not what you forgot but how fast can you recover what you have forgotten when needed.

share|improve this answer
add comment

Forgetting is important for the brain, since it makes it easier to quickly retrieve the most relevant information for today's world.

Outsource your knowledge: write things down or write down where to lookup special information if needed.

For C++, remember http://www.parashift.com/c++-faq-lite/

share|improve this answer
    
Yes - I think it's imperative to "outsource some of your knowledge" to Google. –  Jim G. Dec 2 '10 at 18:30
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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