Janki Method - Using SRS To Improve Programming - Jack Kinsella
Janki Method - Using SRS To Improve Programming - Jack Kinsella
☰ JACK
KINSELLA
! " # $ %
http://www.jackkinsella.ie/articles/janki-method Page 1 of 29
Janki Method — Using SRS to Improve Programming | Jack Kinsella 9/9/22, 17:08
http://www.jackkinsella.ie/articles/janki-method Page 2 of 29
Janki Method — Using SRS to Improve Programming | Jack Kinsella 9/9/22, 17:08
You’ve read that learning by doing is better than passive reading; that
expressing ideas in writing forces understanding; that knowledge needs
constant revision to stay fresh; that creativity comes from linking
disparate ideas; and that your past mistakes are your best teachers. How
many of these ideas do you apply to your learning efforts?
http://www.jackkinsella.ie/articles/janki-method Page 3 of 29
Janki Method — Using SRS to Improve Programming | Jack Kinsella 9/9/22, 17:08
I call this the Janki Challenge, and I invite you to take part.
http://www.jackkinsella.ie/articles/janki-method Page 4 of 29
Janki Method — Using SRS to Improve Programming | Jack Kinsella 9/9/22, 17:08
Every morning Anki calculates which cards you risk forgetting, and then
prompts you to review these cards. Doing your Ankis only takes a few
minutes per day, since you only need to review a fraction of your deck on
any given day.
http://www.jackkinsella.ie/articles/janki-method Page 5 of 29
Janki Method — Using SRS to Improve Programming | Jack Kinsella 9/9/22, 17:08
For every card you review, Anki shows you the question side with the
answer side initially blocked out. Your job is to answer the question in
http://www.jackkinsella.ie/articles/janki-method Page 6 of 29
Janki Method — Using SRS to Improve Programming | Jack Kinsella 9/9/22, 17:08
your head, and then reveal the answer and check whether you got it right.
After you answer, four buttons appear at the bottom of the screen:
“again”, “good”, “easy” and “very easy”. Assess how easily you could
recall that card and then press the appropriate button. Based on which
button you press, Anki determines when next to show you that card, so
answering honestly is crucial if you want the algorithm to work.
http://www.jackkinsella.ie/articles/janki-method Page 7 of 29
Janki Method — Using SRS to Improve Programming | Jack Kinsella 9/9/22, 17:08
Doing your Ankis must hold the same force of habit as brushing your
teeth, and you should feel naughty if you ever miss your Ankis.
http://www.jackkinsella.ie/articles/janki-method Page 8 of 29
Janki Method — Using SRS to Improve Programming | Jack Kinsella 9/9/22, 17:08
spare minute at the office. Anki even synchronizes the state of your decks
across all your devices, so changes to your desktop deck will be reflected
across all of your devices.
The third rule of Janki keeps you focused on what is important in the
moment:
“Learn in context. Pick a project, and learn only what
you need to get it done.”
http://www.jackkinsella.ie/articles/janki-method Page 9 of 29
Janki Method — Using SRS to Improve Programming | Jack Kinsella 9/9/22, 17:08
http://www.jackkinsella.ie/articles/janki-method Page 10 of 29
Janki Method — Using SRS to Improve Programming | Jack Kinsella 9/9/22, 17:08
When you read about programming without trying out the code, you
http://www.jackkinsella.ie/articles/janki-method Page 11 of 29
Janki Method — Using SRS to Improve Programming | Jack Kinsella 9/9/22, 17:08
You will fail to notice critical details. Many things may seem trivial when
you first read about them in a textbook. Maybe it’s the placing of
quotations around a parameter to a function, or rules about where
whitespace is allowed. These overlooked points can often be critical in
practice, and anything less than complete understanding will cripple your
productivity. It is only by trying code out that you will notice the nuances
of these rules, and really understanding the language, techniques, and
commands in question.
http://www.jackkinsella.ie/articles/janki-method Page 12 of 29
Janki Method — Using SRS to Improve Programming | Jack Kinsella 9/9/22, 17:08
Our past mistakes serve as excellent memory aids. This is a major reason
why we learn by doing. That said, not all past mistakes are equally
effective at teaching us lessons; there is a correlation between the
emotional impact of an error and the length of time that lesson will
remain in memory.
Say you make a big mistake. You accidentally push incomplete code to a
live server, taking your app down for 12 hours. You panic to fix it, and as
the customer complaints flood in, you feel stupid and embarrassed. This
emotional punishment serves as a strong reminder of your error, and you
will be more careful when pushing code to a server in future.
Errors with emotional impact are, thankfully, rare, and you are unlikely to
need Janki Method to learn from these. But what about the rest of the
mistakes we make, where the emotional element is diminished or even
absent? We may need to make these mistakes many times before
eventually learning our lesson.
http://www.jackkinsella.ie/articles/janki-method Page 13 of 29
Janki Method — Using SRS to Improve Programming | Jack Kinsella 9/9/22, 17:08
By applying this rule you will substitute real world mistakes with Janki
reviews, and you will consequently learn from your mistakes more quickly
and with less embarrassment and real world error.
Ankifying your past failures doesn’t just prevent their repetition. It also
helps you understand your domain, since the act of performing a post-
mortem analysis and examining the underlying causes of your error
encourages deep thought. Instead of just creating the cards you need to
prevent that particular error, you might immunize yourself against that
entire class of error.
http://www.jackkinsella.ie/articles/janki-method Page 14 of 29
Janki Method — Using SRS to Improve Programming | Jack Kinsella 9/9/22, 17:08
As your experience grows you will be faced with bigger questions, such as
structural decisions about your application, techniques to minimize
complexity, workflows for managing simultaneous versions of your code,
and the tradeoff between code performance and elegance. Answering
these questions requires deep knowledge and sizable experience, and for
this reason you must never miss an opportunity to grow your knowledge
in these overarching issues.
After a large project, such as completion of a new app, take some time to
reflect. Ask yourself big questions, such as:
! Did I waste time going down any dead ends? Is there anything I
could do in future to help me foresee these, and prevent them
from happening again?
! Did I choose the right technologies? Can I come up with a
schema to help me make the right choices next time?
! Did I accurately estimate the time required?
! Could I have built simpler architecture? Could I have figured this
out earlier?
! Can I create a checklist to ease development of that kind of
http://www.jackkinsella.ie/articles/janki-method Page 15 of 29
Janki Method — Using SRS to Improve Programming | Jack Kinsella 9/9/22, 17:08
feature in future?
Sometimes you will see links between cards in your deck. If you note the
connection between these cards you create multiple neural paths to the
same item of knowledge. If one path were to fail, you could still arrive at
and trigger that knowledge from another route. The ability of mind maps
to help you remember works using a similar idea. By looking for and
noting these connections in your decks you add a layer of redundancy to
http://www.jackkinsella.ie/articles/janki-method Page 16 of 29
Janki Method — Using SRS to Improve Programming | Jack Kinsella 9/9/22, 17:08
http://www.jackkinsella.ie/articles/janki-method Page 17 of 29
Janki Method — Using SRS to Improve Programming | Jack Kinsella 9/9/22, 17:08
http://www.jackkinsella.ie/articles/janki-method Page 18 of 29
Janki Method — Using SRS to Improve Programming | Jack Kinsella 9/9/22, 17:08
http://www.jackkinsella.ie/articles/janki-method Page 19 of 29
Janki Method — Using SRS to Improve Programming | Jack Kinsella 9/9/22, 17:08
people’s code. Download open source projects (e.g. on Github) and read
through the code. Look up parts you don’t understand, and create new
cards as necessary. Get a pen and paper, and sketch out the paths through
the program. What are the inputs, and what are the expected outputs?
What happens to the data as it moves through the program? Why was it
designed in this way? What techniques were used?
The eighth rule of Janki encourages you to use your readings of other
people’s code as a source of learning:
“Read code regularly. If you come across something
interesting – be that an algorithm, a hack, or an
architectural decision - create a card detailing the
technique and showing the code.”
http://www.jackkinsella.ie/articles/janki-method Page 20 of 29
Janki Method — Using SRS to Improve Programming | Jack Kinsella 9/9/22, 17:08
Let’s take an example. Say your program uses 100 functions and 70 of
these are built into the language. That means that there were 30 custom
defined functions. If you know with confidence the inputs and outputs of
the 70 built-in functions, then debugging is simplified, since you will only
need to figure out how the remaining 30 custom functions work.
Considering that custom functions are themselves defined in terms of
built-ins, this task should not take too long either. Total certainty about
the syntax, inputs, outputs, and uses of the built-in functions lets you
quickly isolate unknowns and bring the bug to surface.
You might argue that you will get the same speed boost with knowledge
earned through experience. That is true, but this argument misses the
point. Janki enables you to gain that same knowledge faster, and retain it
for longer. If you’ve ever forgotten how to do something after leaving it
aside for a few months, then Anki is for you.
ADVANTAGE 2: CHUNKING
Skill in a technical field is the product of your intelligence and your
knowledge. Weakness in one can be overshadowed by strength in another.
Bright yet inexperienced can perform on par with dull yet experienced.
In approach 1, the problem was labour intensive because you did not use
knowledge to ease your calculation. This wasn’t the case in approach 2,
where you reasoned using higher order chunks of knowledge, so solving
http://www.jackkinsella.ie/articles/janki-method Page 22 of 29
Janki Method — Using SRS to Improve Programming | Jack Kinsella 9/9/22, 17:08
The first time I saw the issue I would spend half a day solving the
problem. Six months later the problem would happen again, perhaps in a
slightly different form. Even though I was vaguely aware of having seen it
before, I’d forgotten how to fix it.
This felt wasteful and I didn’t like it. I don’t like having to solve the same
problem twice. Janki Method helps prevent this from happening.
http://www.jackkinsella.ie/articles/janki-method Page 23 of 29
Janki Method — Using SRS to Improve Programming | Jack Kinsella 9/9/22, 17:08
Anki has a search feature that finds all matching cards in your deck. You
can even filter by date or tag. For example you might search through
cards containing the word “ssh” created more than 6 months ago and
tagged with ‘deployment’.
After solving a bug you should always add some cards to your deck
containing the knowledge needed to prevent that bug from occurring
again. Better yet, abstract one level and add cards containing the
knowledge needed to prevent that class of bugs. Now, whenever you are
faced with a bug the second time, all you need to do is search your
archives.
If you didn’t know the sort algorithm was built into the language, then
you might write your own in its place. When you do so you risk making
mistakes and missing out on low level optimizations. Furthermore you
alienating future users of your code, who might think there was a reason
other than ignorance for why you wrote a custom sort algorithm instead
of using the one built into the language.
By filling your deck with built-ins from your chosen languages you will be
less likely to accidentally implement existing features in a confusing, half-
assed, and bug-prone way.
APPENDIX
SHOULD I DOWNLOAD OTHER PEOPLE’S DECKS?
Anki has an online searchable database of other people’s shared decks.
Although there are not many decks for computer science, you might be
able to find some and piece these together as the basis for your deck.
Be careful with this. You might add facts to your deck that are of no use
to you, and you may end up reviewing facts that you do not fully
understand, thus building a poor foundation for future knowledge.
Ideally you should build your own decks from scratch, drawing from your
programming experiences; your readings of other people’s code,
http://www.jackkinsella.ie/articles/janki-method Page 25 of 29
Janki Method — Using SRS to Improve Programming | Jack Kinsella 9/9/22, 17:08
If you are going to use other people’s decks, make sure you understand
every card you learn. Be sure to try the code out when you first see it; this
takes more discipline that you might have. Make sure you trust the author
of the deck - you don’t want to learn incorrect or dated knowledge, and
sadly most of the decks freely available are abysmal.
It’s not always easy to distinguish between knowledge worth keeping long
term and knowledge only needed short term To help me with the
decision I came up with this schema:
Only enter a card into your decks if one of the following conditions is
http://www.jackkinsella.ie/articles/janki-method Page 26 of 29
Janki Method — Using SRS to Improve Programming | Jack Kinsella 9/9/22, 17:08
met:
Press Enter to reveal answers and then evaluate your response with the
keys 0,1,2 or 3.
Command + E lets you edit a card and then Tab moves the cursor
between the question and answer panes.
Want to learn to program and start building powerful apps? Then take
the Janki challenge. Download Anki (link below), pick a programming
project, and publicly announce to your friends that you’ve committed to
learn to program.
Why public commitment? Public commitment creates social pressure that pushes you to
honour your promises to the world. This pressure will see you through the difficult first
stages where you will be most tempted to give up.
I believe that if you follow the system exactly as described above, you will
learn to program significantly more quickly than you would using any
other approach other than one-to-one tutoring.
FURTHER READING
! 5500 web development flashcards, made by me
! Anki - Available for Free Download
! 20 Rules for Formulating Knowledge in Learning
! Want to Remember Everything You’ll Ever Learn? Surrender to
This Algorithm
! Genius and Creativity
Autodidactism
40 page guide
http://www.jackkinsella.ie/articles/janki-method Page 28 of 29
Janki Method — Using SRS to Improve Programming | Jack Kinsella 9/9/22, 17:08
© Jack Kinsella
http://www.jackkinsella.ie/articles/janki-method Page 29 of 29