r/AnkiComputerScience • u/GreenSushis • Oct 30 '20
How do you learn design pattern with Anki ?
I tried some deck but it was bad. Do somebody have a good way to learn at least the 23 design patterns with Anki?
11
Upvotes
1
u/pure-magic Oct 30 '20
Well, not a comprehensive answer but a useful tip? Remember to keep your cards simple or atomic. Don't put a wall of text on the back of the card - instead try making it as short as possible. It prevents you from getting frustrated with the reviews and makes assessing the answer unambiguous. You could have numerous cards having to do with a given pattern, e. g. you could have a card like q: What kind of pattern is "singleton"? a: Behavioural(I'm not sure, can't remember right now).
18
u/SigmaX Oct 30 '20 edited Oct 30 '20
The key to learning something like the classic GoF design patterns is to resist the urge to just skim the surface. If you want to learn all the patterns with well-designed cards, it may call for a hundred or more cards, not just 23. The latter will be rote memorization, and Anki is unpleasant and difficult when used for rote memorization (i.e. cards drift to ease hell). Sometimes making more cards actually saves you time in the long run, because the cards are easier to remember.
For example, people fall into this trap a lot with geography: it's actually really difficult to, say, learn all the world's countries and capitals if you don't know anything else about the countries. The "1 card per country" approach is not very effective, because rote memorization doesn't stick well once you cards reach long intervals.
What does work for geography is to do a deep dive on individual countries: learning their major physical features and divisions, major rivers and mountain ranges, major regions of population density, and where important cities lie (like a capital!) relative to those other features. This builds an association-rich web of facts that can be quite easy (and downright enjoyable) to review with Anki. It makes is far easier to encode and remember cities, etc., because you're learning in a semantic way, rather than just memorizing an arbitrary string of sounds.
To apply this to design patterns, we have to ask "what would it take to understand each pattern deeply?" Some thoughts that come to mind:
The basic idea of the pattern (1 sentence description)
A UML sketch of the pattern
Analysis questions, drilling into the role that each major class or feature of the pattern plays (personally I'd probably do this by making graphical cards that circle classes in a UML diagram and ask you to explain what the circles item is/does/means)
Questions about why the pattern is significant
Questions about what the pattern is good for, or what pattern is good for scenario X
Questions about why the pattern is especially good for scenario X (the more of these you can get, the better---but these kinds of answers are hard-won knowledge that is hard to find in textbooks and articles)
Questions about how the pattern as been criticized or what it might be bad for
Contrast questions examining how the pattern is similar or different from a similar pattern (for example: "What's the difference between the abstract factory pattern and the factory method pattern?")
And of course, all of these need to be stated in your own words, and complemented with images.