How is your project going?
I didn’t know any Golang, so I gave it a try as an experiment to see how much of the language I could learn in a couple of days, part-time.
I went to Go by Example and read through the 75 pages. I picked that site because it’s short and can fit in a memory palace or peg list. I had followed a short Go tutorial once a couple of years ago, but it was just “paint by numbers” style, and I didn’t even know exactly what := vs. = did a couple of days ago.
I started typing out the code from each page of the site, but that was taking too long, so after about 20 pages, I switched to just reading the code, taking quick paper notes, and explaining how the feature works to an imaginary student. That was as least as useful as typing out the code, and much faster. I didn’t use a memory palace or peg list during the first pass.
The notes are quick and are mostly just to help me reword the ideas while extracting the most important information.
Example: it’s easy to remember “Sorting by Function” is on peg #240 (page 41 of the site, because my pegs are zero-indexed), but there is also other useful information to attach there: Len, Swap, and Less are the methods to implement for the type. I think that the exact syntax doesn’t matter at this stage in my learning, because my editor will provide hints, and it’s easy to search online for an example if I know what I’m looking for.
Then I stored the names of the 75 pages in a peg list using my 000-999 peg list. I used the images for numbers 200-274 as pegs. A peg list is similar to a memory palace, but instead of attaching facts to location pegs, you attach them to other kinds of pegs that you can keep in order. They basically do the same thing, so it was an arbitrary choice.
Here are some examples:
| Peg | Peg Image | Fact |
|---|---|---|
| 200 | Nostradamus | Hello World |
| 201 | Note | Values |
| 202 | Noni juice | Variables |
| … | … | … |
| 240 | Nozzle | Sorting with Functions |
| 241 | Knot | Panic |
| 242 | Naan | Defer |
I used the memo sets feature to review the facts a few times. Because it’s a peg list, I put both images in the memo set instead of making a journey.
Once I had the pegs memorized, I used active recall to try to pull the information out of memory just based on what I stored in my peg list. I didn’t remember all of the details of how to implement the features, so I would go back and check the Go by Example website to look up the missing information. I changed some of the mnemonic images when they weren’t memorable enough.
After that, I used what I learned to write a simple program to generate one file for each page of the Go by Example site:
package main
import (
"fmt"
"io/ioutil"
"strconv"
)
func writeFile(filename string) {
text := []byte(filename)
fn := fmt.Sprintf("%s.md", filename)
ioutil.WriteFile(fn, text, 0644)
}
func main() {
fmt.Println("beginning")
for i := 200; i <= 274; i++ {
writeFile(strconv.Itoa(i))
}
fmt.Println("done")
}
I started writing notes in each file based on the memorized title, just to be sure that I could explain the topics. I use being able to explain something as a gauge of whether I really understand something or not.
Example: I knew that peg #224 was “Channel Synchronization” but wanted to be sure that I could code an example of it. So note 224.md looks like this:
I didn’t write a note file for all the items yet, and I’m not sure if it’s worth the time (vs. just starting to build things with the language). I will keep recalling my peg list regularly and check the site again for any items that I don’t feel like I could explain well.
Before I crawled out of bed this morning, I tried recalling my peg list and started giving a mini-lecture on Golang to an imaginary student. I could still recall all the items and a lot of the information. I wouldn’t say that I “know Go” yet, but I feel like I wouldn’t hesitate to choose it for a CLI or server, because I know the basic concepts and what to search for in order to find the exact syntax for basic tasks. I’m in the middle of working on a new server for this site that is not user-facing, and I might write one of the tasks in Go.
I don’t think rote-memorization alone can really teach something like a programming language, but the peg list definitely helped me a lot with the basics.


