Four months ago I started working on a fairly complex software project. I didn't know anything about the functionality I had to code, but after two weeks of intense research I understood it well. I was very excited about the project and even when not working on it, I would constantly run it through in my head and come up with new ideas on how to make the code more clean, lightweight and efficient. When the project was around 25% finished I had to stop and work on something else.
Now, after two months I'm resuming the project and realize that the understanding I had of the functionality is completely gone. I can read though the code and see what it does, but without the understanding of the functionality I had before, it doesn't really make any sense. I also realize now that this is the case with all other projects I have been working on, at least the complex ones.
I was able to find out how things should work, wrote the code and forgot all about it. The difference between this project and previous ones is that I was able to finish them without interruption. I would then just move on to next project and never gave the previous one much thought, so I never found out that I actually forgot how it worked.
I have been excited about all the projects I have done, but still forgot how they worked after some time. This discovery has made me quite depressed, thinking that something must be wrong with my brain. I can find out how something should work and write the code, but if you ask me in two months how that something works, I have forgot all about it. What kind of existence is that?
A long time ago I saw an interview with Bill Gates where he told that he still knew the source code for Altair BASIC by heart, and that was twenty years after he wrote it.
Do any of you have the same problem?
If you only spent a few weeks working on that new project, then you probably didn't spend near the amount of time Bill Gates spent writing, thinking about, and reviewing his Altair BASIC code. Even though he whipped up his code in less than a month or two prior to the first MITS demo, he likely spent weeks or months after that demo modifying and polishing the BASIC interpreter for subsequent releases. You didn't mention your experience level, but Gates' years of prior programming experience likely benefited him as well, providing him with a nice cognitive framework to which lots of these facts could "stick."
One additional thing: when Gates says he still knows the source code for Altair BASIC by heart, it probably doesn't mean "completely, line-by-line" by heart. I'm guessing it means he still remembers some snippets by heart, or that he believes he could re-write it from scratch from memory (which would still be exceedingly impressive).
Some useful resources on memory and learning:
Memory and Learning: Myths and Facts (http://www.supermemo.com/articles/myths.htm)
Want to Remember Everything You'll Ever Learn? Surrender to This Algorithm (http://archive.wired.com/medtech/health/magazine/16-05/ff_wo...)
Make It Stick: The Science of Successful Learning (http://www.amazon.com/Make-It-Stick-Successful-Learning/dp/0...)