A Learning Strategy for Beginning Coders
Learning to code can feel overwhelming. In this post I'll outline a few strategies for success. If you have ever learned to play a musical instrument you would understand the need to practice. Coding is the same way. You will learn best by writing code.
I often need to learn new things. My favorite technique is immersion. Jump in, and work on small goals. Overcoming small obstacles gives me motivation to keep learning. You may find it works well for you too. Let's look at an example of how that works.
To learn a new programming language (Python), I would first find my goal. Something easy enough to understand, yet complex enough to drive your curiosity. Often I choose to write a simple command line game. For example, Hangman. Do not choose complex goals while learning. If you do your mental energy will be wasted thinking through the details of how to reach your goal. Keep it simple.
Once you have your goal, break it down into small parts and focus on one part at a time. Write down a list of what you need to make a Hangman game.
Hangman Component List – Draw a little stick person a part at a time – Word list to randomly choose from – Get user input – Display output to the user – Limit user letter guesses to the number of stick person parts – Winning: user guesses the word, before using all guesses – Loosing: more letter guesses than the number of parts in the stick person
At this point you can pick one little thing to focus on. Perhaps start by figuring out how to code up a list of words. Next figure out how to make a function to randomly return one word. Then look into how to get input from a user.
As you work on each part of your goal, you will be forced to research things. – How do you make a list of words in Python? – How do you randomly select an item from a list in Python? – How do I get user input from the command line?
This method focuses mental energy into accomplishing small wins. During the process of researching jot down things that you are curious about. Go back and read more on those things. If you are learning something entirely new, this will quickly become a large list. Focus on the small easy wins. How do you eat an elephant? One piece at a time!
Focusing on small steps helps to avoid becoming overwhelmed. Researching and reading on topics you don't understand will quickly build your knowledge. Wisdom will come as you continue to write code. Get started, then stick with it!