Learning the Basics of a Programming Language Using Anki

About a week ago, I started to learn the programming language R for a statistics class that I just started taking. In this blog post, I am going to be talking about the techniques that I am using to memorize this language. This guide will learning R, but you can apply this information to any programming language.

Before we go any further, make sure you have read my guide on Anki, so you can follow along and understand everything.

Now, I will give you some background on the programming language called R. R is a programming language for statistical data analysis, and it is very widely used. My professor picked this particular language because it is very popular in academic research for statistics.

In my class, I am learning R through a platform called DataCamp which teaches you how to program in data-driven languages such as Python, R, PHP, and MySQL. Now it does cost money to learn on this platform. However, it is definitely worth it, but if you cannot afford the price, then there are plenty of free online resources.

What to Make Your Cards Look Like

Alright, so the first type of  cards I like to make are “How do you do _______?” cards. In these cards I will start out by saying “In the programming language ________,” so I know what my card is about. Then I ask a question on how to achieve some goal.

For example “In R, how do I add together 3 and 6?” The answer would be 3 + 6. Another example would be, “How do you assign a value to a variable in R?”

These first type of questions we can call “How to” questions because they ask you how you do something. They are important for programming, so you can always know how to achieve certain goals. Now, the examples I  just gave are fairly simple, but we could do a more complicated example, such as “How do you create a dataframe?”

The next type of question you can ask is, “What does this do?” This is a very similar type of question to “How do you do this?”, but it is just twisted around. For example, I could ask “What does this do: x <- 6 ?”

Now, this is useful when there is a confusing operation that you often mess up. If you make both a “How do you?” card and a “What does this do?”, you will double reinforce the information. Additionally, this is useful when there is more than one way to do something. When there are multiple ways to do something, saying “How do you do this?” can be ambiguous, so I prefer to use “What does this do?” in that case.

Some variations on this type of question are: “What kind of variable will be returned when you do this?” What function will be called when you do this?” etc…

The next kind of question we have is general questions. These kind of questions take the form of “Is R case sensitive?” or “Is R an object oriented language?” These are great questions to make sure you really understand the fundamental parts of a language. My only concerns with these questions are that they are yes or no answers. Generally, questions in Anki should not be yes or no.

You can get around this by asking a more in depth question. For example, you could indirectly ask if R is case sensitive by saying: “In R, what would the result of this code be: “hello” =  “Hello” ”. The answer would be FALSE. If the person answered correctly, they demonstrated that they know that R is case sensitive, so make sure to get creative!

So, we have three kinds of questions:

  1. How do you?
  2. What does this do?
  3. General

Personally, I think it is better to use “How do you?” questions over “What does this do?” when you can. When you are programming, you are going to need to know how to do things, not recognize what is happening. It is not enough to be able to read code for a neural network. You need to be able to know how to make a neural network! Yes, reading code can be useful, but I believe step one should be making your own code.

Now, this only showed you how to make cards for a programming language. In a later guide, I will show you the learning strategy for mastering a programming language completely.

Thank you for reading, and if you have any questions, just comment below!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s