How to Learn Programming Effectively : Think LEGO, not IKEA

Paul Chor
Jumpstart Coding
Published in
5 min readJun 5, 2019
Photo by Fatos Bytyqi on Unsplash

Since last year, I have taught at least 100 people programming. They were from varying age groups, walk of life, academic backgrounds and careers. Some grasp the basic concept quicker than others, while others taking longer and require more practice — and some, well, just don’t get it. Because of the last group, I have spent many hours reflecting why learning programming is easier for some but harder for others, and I will try to pen down my thoughts here.

One of the many insights that came to me pretty early while conducting my lessons and courses is this— To learn programming effectively, one have to treat it less like IKEA and more like LEGO.

LEGO VS. IKEA

At first glance, both a LEGO set and a piece of IKEA furniture share similar features. They come in many pieces, and by following instructions, you get to assemble an end product. For LEGO, it’s something fun and awesome, and for the case of IKEA, something functional (hopefully!).

Photo by Susan Holt Simpson on Unsplash

However, do most people even follow the instructions for a LEGO set? I mean, I remembered they come with some step by step procedures or an illustration of the final work, but I remembering paying no heed to them at all. If the pieces fit, I don’t care if I am following the instructions or not — I would use those pieces to build what I want. Over time, I know what each of those pieces could be. One weekend, those pieces could be a spaceship; the next, a battleship. The following, a group of mechs engaged in dire shootouts and hand to hand combat.

While it is possible to do something with the bits and pieces of an IKEA furniture, the experience of working with the pieces are different from a LEGO set. I notice how frustrated I tend to be with IKEA. I was so focused on the end result — getting bits of wood and metal to resemble a bookshelf. If you asked me what I could use the different parts of an IKEA furniture for, I would just shrug and said I don’t know. How would I know, though? I was so focused on the end result that I wasn’t interested in seeing the possibility of what those parts could be. In fact, as I am not a carpenter or master craftsman, those pieces to me are dead and rigid. Without the instructions, I have no idea what they can do and what else they could be.

PLAY TO LEARN, EXPERIMENT TO MASTER

Here’s an example — RESTFUL APIs call. It should be a case of “teach a man to fish” however how it often transpired is this:

  • I show the students how to call a API endpoint using HTTP GET
  • I show them how to parse the results by inspecting the response
  • The students try out the example
  • I ask them to call another API endpoint using HTTP GET
  • Students, after staring at the screen for a few minutes doing nothing: “I don’t know how to do it, can you please show us the code?”

Trying to figure out the answer first is a big hindrance to programming. Being so fixated on getting it “right”, like assembling an IKEA furniture, is missing the forest for the tree. The inability to understand each part of the piece is one of the factors holding back people to learn programming. We, as a society, are just too darn interested in the correct answers and results. We don’t want to sit down and figure out each piece — we want the solution now.

The refusal to play and experiment while learning programming is baffling. I see many students just sit there, thinking, staring at the screen as if an omniscient Big Brother AI will zap them for typing in the wrong code.

HOW TO THINK LEGO?

When playing with LEGO, we don’t care if there is a correct or incorrect way to assemble the pieces together. If the pieces fit, it’s all good! That’s the same approach to learning programming.

Here’s an experiment to try, if you are a beginner:

  • Take a video that you watching on YouTube or Udemy. Pick a simple one first.
  • Follow the video till it gets to the practical coding part, then pause after each line
  • Fire up your editor (or the ever-reliable http://www.repl.it) and follow the code.
  • Follow the coding segment of the video, line by line. Along the way, look for things you can start changing to understand how it works.
  • When you have followed the example perfectly (i.e, it runs!), go and change stuff. If it is, for instance, to display an image using the HTML <IMG> tag, try with an image from a different folder. Try one from the Internet. Try different file extensions. Try different size. Try putting <IMG> into everywhere else (will it fit in a paragraph? A table cell? Can I put an <A> tag around it? What if I use CSS to change an <IMG> to be displayed as an inline block?)

Another example: If I am learning the FOR loop, I will try to put a FOR loop within a FOR loop. Or an IF within a FOR loop. What are cases where I will put a FOR loop into a IF block?

Or — if I am able to display integers from a list in Python, one by one, can I calculate its average? Can I only attempt to print integers from only the even index?

Too often we wait till assignments or exercises to prompt us to think. This shouldn’t be the case. Programming is like a virtual LEGO set that can be as wide and wild as you like, so don’t hold back in your experiments!

IN ENDING

However, it is understandable if learning via experiments and play is daunting. There are many problems that most beginners face when learning to code — syntax errors, documentation filled with technical jargon, to name a few. In my next article, I will share on the life-saving skill that every developer has to know, but only a few seem to do it well.

How to Google.

--

--

Paul Chor
Jumpstart Coding

Programming Coach/Tutor and freelance project consultant