TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Memorizing a programing language using spaced repetition software

233 pointsby sachitguptaover 12 years ago

31 comments

hackinthebochsover 12 years ago
As others have mentioned, its less about the syntax of a language and more about the plethora of libraries that is the real boon when it comes to using a programming language. It has been said that the majority of a tough problem is worked out unconsciously. If we eschew memorization for "just in time" methods, we are essentially putting a hard limit on the type and difficulty of problems we're capable of solving.<p>I personally think the amount of library functions memorized is the biggest difference between average programmers and the so-called 10x programmers. An extremely high level of fluency with a programming language environment is invaluable when it comes to efficiency and code quality. It is analogous to conversing in a language where one has to look up every other word compared to a native speaker who has a deep fluency. It's not just a matter of speed; the depth and quality of thought is orders of magnitude greater in the fluent speaker. The more of the heavy lifting you can do unconsciously, a vastly higher level of output one is able to produce for the same amount of mental effort. We accept this in just about every profession, yet we resist when it comes to programming. Personally, I'm glad my doctor memorizes a large amount of the facts he uses in his day-to-day work.<p>It is unfortunate that just about every new language brings with it a new set of standard libraries that we must learn to use effectively. We give up so much expertise and efficiency when we don't allow ourselves to build up a high level of familiarity with them. I can imagine a future where there is a standard library of methods that every programmer attempts to memorize and that every new programming language is programmed specifically for this standard library. We are already seeing this with language frameworks like the JVM and .NET, but we need to go even further. Hopefully libraries themselves will be created specifically to be easy to memorize.
评论 #5015947 未加载
评论 #5017730 未加载
评论 #5016155 未加载
评论 #5015749 未加载
评论 #5015940 未加载
siversover 12 years ago
Thanks for posting this.<p>I hope this format is useful to you guys. I actually spent the last two days making a video of this, with screen recordings of using Anki and such, and then felt it's a lot more efficient to just get the info on a static HTML page instead.<p>Any advice appreciated.<p>- Derek
评论 #5015221 未加载
评论 #5015804 未加载
评论 #5015933 未加载
评论 #5015961 未加载
评论 #5015444 未加载
xiaomaover 12 years ago
I was a contributor to Anki and one of the earlier language learning bloggers who wrote about spaced repetition for Chinese learning. One thing I noticed at that time was that those of us Chinese learners who were programmers went <i>crazy</i> about spaced repetition... some went so far as to SRS at the exclusion of actual reading. Other language learners blogging about SRS, often weren't so thrilled about the concept.<p><a href="http://www.sinosplice.com/life/archives/2009/08/06/the-spaced-repetition-party" rel="nofollow">http://www.sinosplice.com/life/archives/2009/08/06/the-space...</a><p>At this point, I'm seeing the same thing again, but distributed to a larger group of people. Everybody and their cousins are making SRS programs for learning languages, often Chinese, and that giddy feeling I had when encountering the idea of SRS seems to be all over the place!<p>How I wish I could explain that the context matters and they'd learn faster by actually using these discrete chunks of knowledge in context! That reviewing decontextualized data is a poor way to synthesize most thing! But who would listen? I wouldn't have 4 years ago.<p>SRS is seductive. It's amazingly good for things in which there is a set number of essentially unrelated pieces of information to memorize (e.g. 5000 common Chinese characters), but it's terrible for learning something more nuanced (e.g. how to read Chinese). I do still keep it as a tool, but it's a special purpose one.
评论 #5015524 未加载
评论 #5017579 未加载
评论 #5016105 未加载
cletusover 12 years ago
This is a good post that I'm glad to see refers to a lot of the work done on the subject of memorisation and it would be very useful for vocabulary building in language acquisition (amongst other things).<p>I can't see the utility for programming languages (compared to human languages) however as the grammar and vocabulary of programming languages are tiny in comparison. The best way to learn them is to write something with them (IMHO). The available libraries are of course broader but the subset you use tends to differ from person to person and actual use will tend to reinforce what you most often use.
评论 #5015337 未加载
评论 #5016288 未加载
评论 #5015996 未加载
rlanderover 12 years ago
I've been doing this for almost a year and I agree it accelerates programming languages/libraries learning. Not having to switch between my text editor and the language/library reference lets me focus on the hard problems.<p>As a programming languages geek, a few months ago a realized that every time I came back to a language that I had learned earlier, I'd forgotten a good chunk of it, rendering all my efforts in vain. So I started using Anki. Here are a few tips from my experience:<p>- Koans[0] are great as source material. They're available in almost every mainstream language, the problems are usually solvable in less than a minute and you can just copy &#38; paste.<p>- Always open your repl and type your answer. Otherwise you're not really thinking about the problem but just memorizing the answer.<p>[0] <a href="https://github.com/search?q=koans&#38;ref=commandbar" rel="nofollow">https://github.com/search?q=koans&#38;ref=commandbar</a><p>*Edit: BTW, I've got lots of Ruby, Python, Clojure, Erlang/OTP and a few Dylan flash cards, if anyone's interested.
评论 #5017505 未加载
评论 #5017994 未加载
amixover 12 years ago
I have been programming for the last 15 years and I still sometimes look things up, even in languages I use daily. I would not really change this, since if I use it often I will remember it - - and if not, it's just one search away. I think memorizing random facts is a really bad way to become a better programmer - - much better ways is to solve problems and read expert code (via ex. GitHub).<p>Regarding the memorization technique I am unsure if this is the most effective way of remembering things. The book "Moonwalking with Einstein: The Art and Science of Remembering Everything" presents a lot of tricks on how to memorize things that could be more effective than the method described in this article.
评论 #5015520 未加载
评论 #5016545 未加载
Expezover 12 years ago
Once you know a few languages, picking one up in the same family isn't that hard. The biggest challenges, for me, when picking up a new language is to:<p>1) Learn to write idiomatic code.<p>2) Learn the name of the library functions, so your flow isn't constantly interrupted by looking for what you need.<p>1) I think, can only be done through reading other people's code. But I've previously thought about doing 2) by using spaced repetition.
评论 #5015339 未加载
crazygringoover 12 years ago
This seems counter-productive to me -- you're going to be spending a lot of time memorizing functions you'll never use.<p>If you just look up function when you need them, you'll memorize the most important ones you use over time, no special practice needed.<p>So I really can't see how this isn't the worst form of "premature optimization". I guess it's fun if you've got nothing better to do, but I'd never recommend it.<p>(But I'm not saying you shouldn't read through a language and its libraries so you know what's there <i>conceptually</i>. That's a good thing to do, so you know what to look up later.)
readmeover 12 years ago
Seems like a less than efficient way to learn and remember a programming language. Unlike natural languages, we can write programs with programming languages. We can run these programs, and if they still work, then they're probably still correct*. You can't do that with written/natural language.<p>As far as remembering programming language constructs and vocabulary, the way to do it is do projects. You use what you learned, and naturally, you're going to come back to it when you have to fix a bug or implement a new feature. All the while, you're building something good, too.<p>Another thing. If you're using a well-designed language, the concepts will incrementally build on themselves. They won't just be a bucket of orthogonal concepts, (like PHP, which seems to be mentioned in the article). Therefore, by learning fundamentals, you can more easily understand and decipher more advanced concepts. So, maybe you did forget what something does. But after a few minutes entering commands into a repl, you fully understand it again, because of your crystallized knowledge of other concepts.<p>I can't imagine a worse way to learn a new programming language than brute memorization.
评论 #5015766 未加载
oscardelbenover 12 years ago
Oddly enough, I've tried SR multiple times in the past, with very bad outcomes. For example, if I added 10 new english words on day 1 (english is my second language), I would only recall ~10-20% the day after.<p>Then a few days ago I started reading The Memory Book which really emphasizes on <i>visualizing</i> things, making correlations, etc. The effort of visualizing and using imagination really made a difference: in one hour I memorized the list of 50 states forward and backward with almost 100% accuracy after 2-3 days (I had never head of some states before).<p>Quickly after I realized that my limited english vocabulary was also the weakness in this system, so I started visualizing and adding new words to Anki once again. The result is that my recalling after 24 hours is close to 80-90% for new words, which is encouraging.<p>I've been doing this for ~1 week, so take it with a grain of salt, but for me it seems that visualizing the words <i>and</i> using SR is helping. It takes 3 times the effort, but as long as I remember things, I don't care.<p>The idea of applying the system to programming sounds interesting, and definitely worth a try.
评论 #5018602 未加载
SatvikBeriover 12 years ago
When I was 12 years old I had a family friend-let's call him James. James was the son of my dad's best friend, and I saw him as a bit of an elder brother figure. I followed him around and tried to copy anything I saw him do, usually unsuccessfully. One day I saw James make a website. Naturally, I had to start making websites, so I whined at my dad until he bought me the <i>HTML Black Book</i>, and read the thousand-page tome cover to cover in a weekend-pretty much the exact opposite of the "find a project first" approach. Then I started making websites.<p>Having read the entire book was incredibly helpful. Anytime I thought of a feature I wanted to add, or wanted to rearrange the site in a certain way, I knew how to do it-or at least, I knew that there was some pattern that would easily solve exactly what I wanted to do. I made sites for myself, for my school, for my friends-and they were decent. Not fabulous, but my sites were a lot easier to update and maintain than the site my school's $250/hour consultant had built (tables were visibly different on each content page!)<p>I used the same approach when I finally started writing code professionally 10 years later. In one case I solved a problem in 17 minutes that my coworkers had spent months trying to solve, because I knew that there was an existing function that did exactly what they were looking for. These things were surprisingly hard to find in Google, but having near-encyclopedic knowledge of the language's features made it a lot easier. Instead of searching for a general problem in an obscure language, I knew the exact function name I was searching for and only had to look up syntax.<p>Memorization is incredibly useful, even in a problem-solving discipline like programming. And having an encyclopedic knowledge of your language is extremely rewarding when you remember a simple way to solve a complex problem :)
jdeeover 12 years ago
We are working in this space. <a href="http://www.codesonic.com/" rel="nofollow">http://www.codesonic.com/</a> . Spaced repetition software just for coders. Launching in a couple of weeks.
gmt2027over 12 years ago
Frequency analysis of human language shows that word usage follows a Power law distribution (Zipf's Law) which, for example, means that:<p><pre><code> * the 75 most common words make up 40% of occurrences * the 200 most common words make up 50% of occurrences * the 524 most common words make up 60% of occurrences * the 1257 most common words make up 70% of occurrences * the 2925 most common words make up 80% of occurrences </code></pre> Speculatively, similar frequency analyses of library calls in various codebases for a programming language may reveal a similar long-tail distribution. This would provide a list of high frequency library routines that would be worth memorising - with clearly diminishing returns as the vocabulary grows.<p>This kind of analysis would also point at important targets for optimisation, simplification and parallelisation as well as direct the efforts of library implementers for new languages.
urlwolfover 12 years ago
I'm working on an coder app that uses SRS. More like 'Twitter for code, with SRS'. I want to 'follow' people who produce good cards, and get their feedback on the cards I make. This would make it superior to just having a snippets.txt file that I eventually import into Anki. Killer search, with tags, would make it better than github gist (although this will be integrated)...<p>Oh, and the scheduler is taylor made for code (code chunks usage is different from word usage, which means the equation parameters optimized for word learning won't work).<p>Contact me if you want to know more (see profile).
评论 #5017975 未加载
kumthekarover 12 years ago
Interleaved and spaced practice is a very powerful learning and knowledge retention technique. Some of recent findings in cognitive science has given credence to this approach. If anyone is interested here is the link to one of the research papers.<p><a href="http://uweb.rc.usf.edu/~drohrer/pdfs/Taylor&#38;Rohrer2010ACP.pdf" rel="nofollow">http://uweb.rc.usf.edu/~drohrer/pdfs/Taylor&#38;Rohrer2010AC...</a><p>I think memorization doesn't really help understand the fundamentals of any topic. Rote memorization can only get you so far. As concepts get harder and complex, dependence on mere memorization leaves a lot of holes in the understanding of any subject matter.<p>Specifically in programming, syntax or semantics form just a minor part of overall problem solving exercise. Efficient and effective programming requires repeated use of concepts or paradigms in solutions for diverse problems. Our brain is much more effective in registering and recalling facts or knowledge when that piece of knowledge is exercised in diverse scenarios.<p>I am a co-founder of Lymboo Math (<a href="http://www.lymboo.com" rel="nofollow">http://www.lymboo.com</a>), an online math practice program for elementary school children. We built the curriculum that follows the natural learning sequence of math concepts. On top of the comprehensive curriculum we implemented a practice structure that relies on interleaved and spaced practice. Students practice daily on individual topics until they are proficient in that topic. Then they move on to subsequent topics along the prerequisites-based curriculum. Throughout the program the system automatically incorporates spiral reviews of previous topics at regular intervals of time to effectively cement all the acquired knowledge.<p>What we have found is that children easily forget what they have learned just a weeks earlier, and their performance degrades in the initial mixed spiral reviews. However, as they continue the cycle of (learn--practice--review)*, they show improved performance in subsequent spiral reviews.<p>Mixed spiral reviews model interleaved (mix of topics) and spaced (in time) practice to enhance our context-switching skills. The neurons in the brain make new connections and store patterns that aid in quick and fluent recall of knowledge.<p>Interleaved and spaced learning techniques are more than just for memorization.
评论 #5017116 未加载
tbirdzover 12 years ago
Very interesting idea, I think it could be very useful. Hopefully we'll see some community spring up around this idea and start sharing some anki decks for their favorite languages. I know I'll certainly start working on a couple of my own.<p>One idea for further expansion: go beyond just having specific language syntax, and also include cards on more generic algorithms and data strucutres. You could key it by time and space complexity, invariants, maybe also a pseudocode implementation.
评论 #5015247 未加载
atsaloliover 12 years ago
Sounds like SuperMemo <a href="http://www.supermemo.com/" rel="nofollow">http://www.supermemo.com/</a> by Piotr Wozniak (<a href="http://en.wikipedia.org/wiki/Piotr_Wo%C5%BAniak_%28researcher%29" rel="nofollow">http://en.wikipedia.org/wiki/Piotr_Wo%C5%BAniak_%28researche...</a>). Piotr has been working on computer-aided spaced repetition since 1987. He's got a lot of data on his website. He was written up in WIRED magazine a few years ago.
cotsogover 12 years ago
Reminds me of the 'Janki Method':<p><a href="http://www.jackkinsella.ie/2011/12/05/janki-method.html" rel="nofollow">http://www.jackkinsella.ie/2011/12/05/janki-method.html</a>
ippislover 12 years ago
Here's a link to someone's flash card for learning web-dev(variety of subjects, 6000 cards) :<p><a href="http://www.oxbridgenotes.co.uk/other/web_development_flashcards" rel="nofollow">http://www.oxbridgenotes.co.uk/other/web_development_flashca...</a><p>Here's a link to a blog post by him describing the technique for programming:<p><a href="http://www.jackkinsella.ie/2011/12/05/janki-method.html" rel="nofollow">http://www.jackkinsella.ie/2011/12/05/janki-method.html</a>
thameeraover 12 years ago
I do exactly the same thing with email + followupthen. This means no need to remember to load up Anki everyday and practice. It comes straight to your inbox. Wrote about this here: <a href="http://thameera.wordpress.com/2013/01/06/spaced-repetition-like-a-boss/" rel="nofollow">http://thameera.wordpress.com/2013/01/06/spaced-repetition-l...</a>
nnqover 12 years ago
...this could only make sense if you want to maintain fluency in <i>programming languages that you are not using regularly</i>. And why on earth would you want to maintain fluency in a language you are not using?! It's not as if you'll forget the basic concepts.<p>IMHO, if you want to maintain fluency in a programming language you're not using, say to keep your knowledge of C and C++ fresh while you're working in higher level language, you should <i>keep contributing to a bunch of open-source projects written in that language</i>, same as for natural languages you need to keep conversing with people that speak it or at least watching movies in it. Otherwise you'll end up knowing and artificial subset of that language that's useless for real work... And the plus is that having the os projects contributions in your resume will keep you employable for future work in that language.
infinita740over 12 years ago
There is a website that use the same concept to teach you languages, world capitals, even Vim or shell commands and you can create your own courses. I use it to learn mandarin, it's really useful. (<a href="http://memrise.com" rel="nofollow">http://memrise.com</a>)
troyinjapanover 12 years ago
Mnemosyne is the best spaced repetition software out there. Free and open source too.
评论 #5017698 未加载
peteretepover 12 years ago
I have been doing this for a while; I wrote a blog post about it:<p><a href="http://www.writemoretests.com/2012/02/how-to-remember-everything-ever-and-forever.html" rel="nofollow">http://www.writemoretests.com/2012/02/how-to-remember-everyt...</a>
druckenover 12 years ago
I do not see the point of using SRS in something like programming.<p>Unlike a human natural language, there is little value in trying to <i>memorise</i> extreme details without the trial of placing them in an application context. As for new concepts, the value flows from the mere effort of initial understanding and any consequent usage. Meanwhile, the core of a programming language is almost always easily learned just by using it directly.<p>Of course, an SRS usage as described could be <i>very</i> useful for other contexts, e.g. remembering programming code snippets or concepts for the purpose of interviews.
fschwehnover 12 years ago
I'm going to give it a try. There are certain programming languages that I use rather unfrequently like python or bash script. But when it comes to the point that I need to use them, I allways realize that I tend to forget so many useful commands and API calls, so I have to look'em up once again and again. My point to this phenomenon is, that when I'v just looked up a (in my eyes) complicated unix command e.g., that at this very moment I know that I won't remember it two or three days later. This tool might be a good help to note them down and help me to memorize them.
sk55over 12 years ago
I've been memorizing parts of Ruby with this method while reading "The Well Grounded Rubyist." You can import all my Ruby flashcards into Anki. Hope they help. Please email me if they do (email is in profile).<p><a href="https://docs.google.com/folder/d/0B_WU5GXujPOVSl9WajFaaWlCTGc/edit" rel="nofollow">https://docs.google.com/folder/d/0B_WU5GXujPOVSl9WajFaaWlCTG...</a>
arnejenssenover 12 years ago
Great article. I've made a chrome extension for making it easy to capture learning from internet and do spaced repetition. Check out <a href="http://memobutton.com" rel="nofollow">http://memobutton.com</a>
评论 #5016285 未加载
VaedaStrikeover 12 years ago
This is something I've thought about for so long!!!<p>It's one of the coolest things I've seen in years!!!
tkahn6over 12 years ago
The examples you give are idiosyncrasies that shouldn't be in your code base in the first place (IMHO). These are things that vary from language to language and trusting yourself and others who are going to be reading your code to keep track of them correctly is not a good idea.<p><pre><code> a = 5 + '5' </code></pre> Ignoring the lack of a sigil, in PHP, a = 10.<p>In Python, this fails to typecheck.<p>In Javascript, as you note, a = '55'.<p>(I used an interpreter for each of these languages to verify this)<p>For me, I could potentially see the usefulness for this in two things: the various meanings of the 'this' keyword in Javascript and the positioning system for CSS. I always have to look that stuff up. Never seems to stick.<p>Otherwise, the 'factoids' I have 'memorized' are all out of necessity and come from repeated usage. I don't consciously memorize anything.
评论 #5015460 未加载
rheideover 12 years ago
This is the same as learning kung-fu moves by staring at pictures of them.