Show HN: Code Cards – Anki for code
codecards.me
codecards.me
Code Cards's differentiating feature is the ability to type the answer before viewing it.
But I've found it's crucial that each card be fast. Typing the answer would be way too slow.
For Ankying something like "echo $PATH | tr ':' '\n'", it's better to create multiple fill-in-the-blanks cards testing each part:
* Write $PATH on separate lines: ___ $PATH | tr ':' '\n'
* Write $PATH on separate lines: echo $PATH ___ tr ':' '\n'
* Write $PATH on separate lines: echo $PATH | ___ ':' '\n'
* Write $PATH on separate lines: echo $PATH | tr ___ '\n'
* Write $PATH on separate lines: echo $PATH | tr ':' ___
(Skip the first two if you already know "echo" and "|".)
When these cards come up you only need to spend a fraction of a second. And if you forget one part, you only need to fail that one part.
Still a nice project. Anything to increase awareness of Spaced Repetition :)
Do you have some examples of using the input field? I tried to get it to work a while ago but had issues with it. How does it play with code specifically?
1: I wrote about it here https://www.oskarth.com/srspractice/
Aside from that, patience is key. 10 or 15 cards per day adds up over a period of years
Write {{c1::$PATH}} on separate lines: "{{c2::echo}} {{c3::$PATH}} | tr ':' '\n'"
The card above will be 3 separate cards, but takes only about 10-20% more time than creating regular cards.
One way I like to think about it is as a continuum - there are certain things you use everyday and thus in a sense over learn. Then there are things you only use once or twice in your life, such as a specific configuration you have to do. Code Cards is for the things in the middle, the things you only use every now and then but keep forgetting and having to google over and over again.
In terms of using it as an aid for people learning programming, I think if you spend 4 hours a day effectively coding, then spending 5-10% of that time reinforcing some of the things you've learned during the day is not a bad use of your time.
A critical factor here, though, is that it's very clear from the spaced repetition/testing literature that the way you learn beforehand affects retention. (e.g. Karpicke and Roediger 2008).
Rather than trying to remember how to do a hundred trivial tasks correctly I focus on the task at hand and keep the reference document up on the other page.
I find it more valuable to have up to date and practiced referencing skills than to memorize a few hundred utility functions.
As an added bonus there's an intrinsic passive search for new techniques and depreciated methods.
A big benefit of testing concepts is that people often overestimate how well they've learned something, so someone may think they have the concept down and that testing is unnecessary, which makes seeing spaced tests is a sort of long-term memory reality check.
[1]: http://learninglab.psych.purdue.edu/downloads/2008_Karpicke_...
In the end, I determined that I learned a lot more from making the cards than I did from studying them.
So yeah, it was a win... But hardly the way I expected.
I found the same thing. The discipline of boiling things down into their essentials really forced me to pay attention and really thinking about the reading material.
Rule 1 and 2 from https://www.supermemo.com/en/articles/20rules are these:
> 1. Do not learn if you do not understand
> 2. Learn before you memorize
I use Anki to retain programming snippets and gotchas in the same way that Derek Sivers describes here:
This article cited there is well worth reading too, as it's specific to programming:
Do you have any specific request for the types of things you would like to see?
- classic topics like string manipulation in all major languages, the 10/20 most important Linux commands/SQL queries.
The only downside to that was that for "good" decks that tended to be copied, there wasn't a way to see what was the "best" version of that deck or what was different. For example I had a deck that was copied a couple dozen times, and I'd make improvements to it (such as formatting, adding new questions) and none of those copies would get my updates.
So you could improve on Anki's shared deck feature by treating each deck like a github repo, with branches, pulls, etc.
Another thing I'm considering is making the cards sharable as first-class citizens (perhaps under an umbrella category), rather than just dealing with decks. Do you think this would be interesting or do you think decks are an inherently better model?
This is somewhat related: I myself wrote an app to keep track of foreign phrases.[1] (I'm adding spaced repetition to review things just like Anki, too.) You write down the phrase in your source language (say English) and then the same phrase in your target language (say German). It works fine for that, but I found it ALSO useful for writing down hard-to-remember command lines I needed at work. For instance, I'd create an entry like this: for the source language phrase I'd type in something like "Start a build" and then in the target language phrase I'd type the actual command (typically very long and hard to memorize). When I needed to look up the command, I'd just type "start a build" or even just "build" (it shows multiple search results immediately like Google would). Then it's a matter of copy-pasting the command into the shell.
You could do the same thing by writing a shell alias or a script with a descriptive name, but I found looking things up with descriptive words better.
In both cases, it worked better than I was expecting it to. I have no doubt that I would quickly forget either method, as I don't use them often, but I can at least type them up quickly into a scratch buffer. Even better, by having the entire thing worked out out and known at the algorithm layer, I was able to focus on some of the language specifics in implementation later.
All of that is to say, it was great for remembering pseudo code that I would then later focus on implementing. Gave me a much better appreciation for pseudo code, actually.
I've previously experimented with using Anki to retain programming skills, with some success: https://www.oskarth.com/srspractice/ It still didn't feel quite natural. Another benefit of being able to code in the question directly is that you get things like syntax highlighting (and eventually, a sandboxed live environment).
The main features I plan on adding are importing Anki decks and sync across devices.
My main question would be, how do you feel about a "Do you know this? Yes/No" vs Anki's method with more options? How do you sync your data on Anki? What would make you consider switching?
Edit: woah why the downvotes? I'd love to improve my question or remove it if not welcome so please leave a note.
I need to add an animation of this flow but the beta landing page is up at http://beta.manabi.io (it's also exclusively for learning Japanese).
[0] - http://imgur.com/a/ZKlCi