About The Meta-Memory Practice Specialized in Computer Programming

Dear Art of Memory Members,

My question is specifically for experienced memory practitioners OR for beginner/intermediate/advanced learners who are trying to improve their memory, especially for computer programming.

Background: I am a computer engineering student who uses Rust, C++, and Python daily for hobby projects, school projects, research programs, and internships. I would like to improve at memorizing lines of code, function names, and syntax, especially for Rust and C++. I am a beginner at memorization, and I think I am below average at memorizing things, like I never naturally memorize songs or cinematic scenes, even though I find them memorable. However, I am very interested in learning new stuff in coding and study at least 4-5 hours daily, mostly due to my curiosity. I do not have any experience in memory practices but I want to get that area in the right and good way possible.

Question: What are the meta, I mean, the latest current gold standard of memorizing lines of code, function names, and syntax in the area of programming and what are the experiences you have? Are there any open-source projects that I may use in this scope to improve my learning and fasten or deepen my learning as a whole? I am open to any ideas and opinions, and any discussions.

1 Like

memorize pseudo code and translate

1 Like

Great question. Memorization is indeed crucial for computer programming, lest one search for the right code in a forest of documentation, or forget how to implement a particular algorithm in a particular flavor.

I am not familiar with state-of-the-art methods for code memorization, but I can speak about my own experiences.

The first step you should take, regardless of language or your memorization intent, is to understand the tokens (word, symbol, etc.) of the language. What do they do? There aren’t too many different types of tokens, and the reserved words (e.g. for, while) should become familiar within a few weeks.

I’ll separate my discussion into two different types of code: standard/library functions and algorithms.

Standard and library functions are mostly a matter of knowing the right syntax, e.g. for printing to the console, C++ uses std::println(material); (semicolon required) while Python uses print(material) (semicolon not required). With specialized modules, such as matplotlib, knowing the right commands for creating a heatmap are also mostly rote memorization; you just have to know it.

Algorithms, on the other hand, are more about design and approach than memorizing the right tokens. Knowing what algorithms do and how they do it will get you 75% of the way there.

I’d spend time analyzing what the algorithm actually does and means. For instance, why is there a while loop after the initialization of x? Why is there only one return statement despite multiple if-else blocks? Why a less-than sign instead of less-than-or-equals?

Then, I’d memorize the flow of logic: first we declare variables, then we go into a nested if loop, etc.

Finally, I can look for particular syntaxes or quirks that make memorization hard, and just drill that code repeatedly until I can accurately recreate the algorithm from memory. There may be particularly clever or standard one-liners you just have to know.

2 Likes