
Show HN: Code Cards – Anki for code - oskarth
https://codecards.me/
======
xamuel
I use Anki for code. Here's why Anki beats Code Cards.

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 :)

~~~
skiman10
Can you share your cards? I find it better to use prebuilt cards for me
personally because I like to go through them as quick as possible and by
making my own cards I feel like it slows me down for the marginal return I get
for making them myself.

~~~
xamuel
I'd like to share sometime but it'll take work to filter out copyrighted and
personal material.

------
userbinator
Spaced repetition is good for pure memorisation but I'm not so convinced it is
an effective or even helpful way of learning programming --- it seems it would
just make you fixate on syntax and not truly understand things.

~~~
oskarth
I agree it's not a good way of learning programming. To me it's a way of
_retaining_ some programming knowledge - but to retain something you need to
understand it beforehand. It doesn't make sense to use this type of thing for
things you don't understand in the first place.

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.

~~~
YCode
Lately I've been finding it more efficient to just offload a lot of that to
search queries and reference sites (i.e. StackExchange, MDN, DevDocs).

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.

~~~
canes123456
I think it useful when learning a new language or framework. When you are
completely new you can spend 90% of the time just searching for trivial
answers. It also takes longer to search because you don't know really how to
frame the question. I find it more useful to go quickly go through a book or
online course and try to memorize some of the basics from the book before
starting. Not reviewing earlier topics results in very little retention.

------
vitomd
Derek Sivers has some anki cards for javascript and ruby . And a good post
about it [https://sivers.org/srs](https://sivers.org/srs)

~~~
nv-vn
I don't understand using this to learn a language. It might help you get the
syntax, but there's no way to understand semantic concepts happening behind
the scene. Just imagine trying to understand monads by memorizing how to use
them. Personally, syntax isn't something I've ever struggled to retain, and
apart from that I feel like this would be much too much work to learn a new
language.

~~~
taeric
I want to agree with this. But I have to confess that my children are
memorizing basic facts like "refridgerator holds milk" without having to
understand any of the magic of the fridge quite well. Seems memorization of
surface facts helps, a lot.

------
ben174
I've always kept a README.md in my dotfiles repo with all the bits of
information I'm trying to memorize. I keep it either printed out, or a
screenshot as my desktop background. Works well for me:

[https://github.com/ben174/dotfiles](https://github.com/ben174/dotfiles)

~~~
artacus
I'm going to make this work for me too.

------
hmate9
It would be great if there were some predefined cards so that maybe I could
refresh my Haskell knowledge or something without me having to create the
material. But nice job overall!

~~~
oskarth
Thank you! And I absolutely agree, this is on my TODO list.

Do you have any specific request for the types of things you would like to
see?

~~~
inanutshellus
It's been a few years since I used Anki, but one of the things that was great
was that their decks were public. You could search for and take someone's deck
and change it to fit your own needs, which was spectacular.
([https://ankiweb.net/shared/decks](https://ankiweb.net/shared/decks))

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.

~~~
oskarth
I have used shared decks a few times, but it hadn't occurred to me that you
could apply the open source of branches/pulls etc - interesting idea!

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?

~~~
inanutshellus
It depends on how much effort you see going into each card. I always used Anki
on a per-topic basis, and each topic was organized into a deck.

------
allenu
I don't know if using spaced repetition works that well for "memorizing" code
that you don't use normally. Coding is the kind of thing that you do where if
something is done rarely, it's probably not something you need to commit to
memory. Just do a look-up of it on Google or Stack Overflow. The thing you're
memorizing is too conceptual, unlike a foreign word or phrase.

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.

[1] [http://www.ussherpress.com/lpb/](http://www.ussherpress.com/lpb/)

~~~
taeric
I gave it a small go recently to try and learn "loopless" methods for
permutation generation. Also used it for heap methods. Plan on using it for a
few other things, but haven't gotten there, yet.

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.

------
franciscop
oskarth, I created something related but with a totally different interface
and goals. I'm going to release the core evaluation _engine_ as Open Source
soon and would love your opinion. Is it okay if I ping you when I do so?

~~~
oskarth
Of course! Ping me on twitter at @oskarth or email me@oskarth.com

------
closed
Love the concept and simplicity of the site. Compared to hitting a site with a
ton of text and a login, starting by storing cards locally made trying it out
a breeze.

------
xiaoma
Longtime SRS user and Anki contributor here. Can you explain a bit about what
this does that Anki doesn't? Can I import my Anki decks?

~~~
franciscop
Hi xiaoma, I am not OP but I made this early prototype:
[https://anchor.science/](https://anchor.science/) and I would love to hear
your opinion. The focus was on the interface and mobile website version
(untested on iOS). Now I am using it daily and polishing out rough edges.

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.

~~~
xiaoma
I'd suggest having cards where the user has to look at them and try to
remember the answer rather than showing both sides of the card at once. It's
just way too easy to cheat oneself by clicking the checkmark without actually
having recalled the back half otherwise.

~~~
franciscop
I just pushed that yesterday as my friend was asking me how to learn it the
first time he sees a new word. The 2+ you do one card it will be hidden until
you tap it/press space. But noted, as I want to make it as intuitive as
possible.

~~~
inanutshellus
Definitely need to hide the answer, even for the first time through. Not
having the answer already there forces you to stare at the character to say
"Wait, _do_ I know this? ... is it ' _foo_ '? _click_ Oh, shoot, no it's '
_bar_ '"

~~~
franciscop
Fixed! Also released the library powering it:
[https://github.com/franciscop/recordar](https://github.com/franciscop/recordar)

------
sleepychu
Something is wrong on your site, I've taken a screenshot of my developer
console. It looks like you keep fetching the content in a loop forever?

[0] - [http://imgur.com/a/ZKlCi](http://imgur.com/a/ZKlCi)

~~~
oskarth
This is on purpose. The scheduling of cards is done server-side and I use
polling (perhaps too eagerly) to fetch new reviews, including of cards that
have just been created. I'd eventually like to find a better solution for this
(such as pushing from the server, do more work locally, etc) but it's not a
top priority right now.

~~~
sleepychu
Cool, as long as you know :-)

------
aaronarduino
Kinda reminds me of this iPhone app I found recently:
[https://www.enki.com/](https://www.enki.com/)

~~~
inanutshellus
Making a new version of an existing app (as the original submission is, with
Anki) is fine, but to ape the name is pretty low-brow. Anyone want a
MacDonalds hemburger?

------
curiousDog
Fantastic. I've recently been coding in Go and was thinking about doing the
same to memorize the language. Do you have plans to write an iPhone app?

~~~
oskarth
Not yet but I've tried to make it work OK on mobile and build in offline
access from the start, but it's still a work in progress. How would you deal
with coding on a touch screen? It seems difficult to me with all the special
characters, but I must admit I haven't done it a lot.

------
Dangeranger
It's interesting that I was just looking for something like this over the
weekend.

