Learning how to Learn (to Code)

Learning how to Learn (to Code)

Using learning strategies to help me complete #100DaysofCode successfully.

Since this summer, I've been on a voyage of discovery into the world of coding, learning how to code in Python, as well as delving into web development. I'd seen the course 'Learning How to Learn' by Barbara Oakley and Terrence Sejnowski recommended by a number of tech sources, including The Odin Project, and Leon Noel of #100Devs, and I thought that anything that could help me to learn more efficiently would be worth the time upfront. I've summarised the main points that I took from this course, and how they applied to learning coding below:

Key Points:

  • There are Two Modes of Thinking!

  • The best ways to learn - Chunking and Recall

  • Practice - The Goldilocks Zone

  • Procrastination

  • Perseverance

  • People - Benefits of a learning community

The Two Modes of Thinking

You might have heard about Daniel Kahneman's concept of 'Thinking Fast and Slow'. Oakley and Sejnowski talk about these two modes of thinking as 'focused' mode and 'diffuse' mode. Focused is when you are intent on what you are working on, you are using your full concentration, and you are actively using your working memory. On the other hand, the diffuse mode is in play when you are not specifically working on anything, or thinking about anything in particular. In this mode, your brain can make connections between new learnings and existing knowledge, and creativity is not dulled by reality.

How did this apply to my coding? I did find that I would get insights after I had stepped away from the computer and done some other mindless task for a while. It seems like scrolling on Twitter or Facebook engages your brain a little too much in order to let the diffuse mode of thinking take over. So I found activities, like walking or running, dozing, having a shower, or doing the dishes, would be better for allowing this diffuse mode of thinking to take over and start to solve my problems! (See the Footnote for more details).

Hard start - jump to easy: One of the suggestions that Barbara Oakley makes is that if you are working on a big project or problem, you should take an overview of the whole project/problem first. Then your brain can start to (subconsciously) process the harder problems in the background as you work on the easier sections initially.

The best ways to learn - Chunking and Recall

What are chunking and recall with regards to learning? Chunking is breaking large information into ‘chunks’, understanding these chunks by making meaning within them, and then being able to easily use these chunks in different contexts in the future. The best way to remember information? Recall! Simply trying to recall and summarise your learning has been shown to help concepts to stick better than re-reading, highlighting, or mind-mapping.

In coding, chunking might mean understanding how dictionaries are structured in Python, which also can be applied to understanding objects in JavaScript. Recall can be practiced by deleting code and rewriting it, and always typing code snippets, (rather than copying and pasting) to help syntax stick.

Practice - The Goldilocks Zone

When you're practicing something to learn it, you need to be doing directed practice. i.e. you should be working at the edge of your understanding of a subject, not too easy (which is pointless), and not too difficult (as your working memory will become overwhelmed and you will be overwhelmed too!) In teaching, we talk about being in the Zone of Proximal Development (ZPD), which is the area where a student can complete work with assistance from a skilled partner - in coding this could be a study partner, a discord group, or tech Twitter!

Procrastination

One of the drivers of procrastination can be the fear and pain of producing a terrible end product. So one way to overcome this is to focus on the process, not the end product. Using a Pomodoro timer and saying that you will just work towards something for twenty-five focused minutes is a good way to just get started on a project. I've been using Pomodoro.io to time focused work sessions and it's a satisfying way to record and reflect on the amount of time spent on specific projects.

Perseverance, aka 'the virtue of the less brilliant'.

The more you practice something, the better you will get (as long as your practice is directed and correct!). So basically if you can persevere in your practice, then you will achieve your goals sooner or later. For me, working on #100DaysofCode meant that I was obliged to code every day, and my stubbornness in keeping this consistent streak going helped me to continue coding even when there were times when I would rather have not!

Benefits of a learning community

Having a learning community can help you to see the big picture in your learning, and steer you in the right direction when you’re going wrong. It can also be motivating, as there are times when you will feel like an absolute dummy, or be in the pit of despair, and people will help to pull you out of there! Helping others to understand a concept is an excellent way to solidify your own knowledge, and in turn, your community can help you work through problems at the edge of your understanding (i.e. within your ZPD ;).

Bonus - Knowledge collapse!

Sometimes when you are learning something new, which requires you to change the way you think about something, you might feel like you understand absolutely nothing about the subject, and you’re right back at the beginning. What could be happening is called a ‘knowledge collapse’, where your brain is restructuring all your knowledge on the subject, based on the new information that has come in. Just give it a bit of time!

Footnote:

When I was reading more about this concept of focused and diffuse thinking, I found an interesting article in [Frontiers in Psychology] (https://www.frontiersin.org/articles/10.3389/fpsyg.2016.00161/full). This notes that there are a couple of different ways to reach solutions to problems: analytically, or through insight.

One way to reach a solution is to search the problem space by analysis, following the most likely paths in a gradual approach towards the solution with awareness of the intervening steps. (i.e. the focused mode of thinking)

Insight is a form of creative problem solving that appears to be distinct from analytic solutions because it relies on the sudden reorganization of a mental representation of a problem (Sternberg and Davidson, 1995), and it often seems surprising to the solvers, who are typically unaware of how the reorganization occurred, yet remain confident that the solution fits the whole problem.

Looking at nothing/focusing on nothing in particular, and increased blinking, has been found to be associated with insight solutions. The research has demonstrated that ‘looking at nothing’ and blinking are associated with reduced analysis of the external visual environment. Thus, looking nowhere appears to indicate (and likely facilitate) a shift of attention from external to internal stimuli, which benefits creativity and problem solving by reducing the cognitive load and enhancing attention to internally evolving activation.

The article also suggests that manipulating eye movements might induce attentional states that are more conducive to either analytic or insight problem-solving. Personally, I found that when travelling by train, I was able to get into the diffuse mode of thinking more easily - this may have been due to the changes in eye movement when looking out the windows of the train.

To conclude - if there is anything you would like to learn or a problem you're stuck on; grab your community, work on it in a focused way for twenty-five minutes, then hop on a train, zone out and wait for the insights to flood in!