Helping others to understand coding

Programming is hard. However, teaching programming is even harder. This blog post will show you various methods to make programming and computers more accessible for people who want to understand tech from a less theoretical angle. My experience with this topic stems from both Rails Girls Berlin workshops as well as various classes I’ve taught at university. While some of the links I’m including are aimed at children, I’m also using those methods for adults – because learning should be fun and you’re never too old to play. It just depends a bit on how you frame it.

As Rails Girls Berlin organizes workshops mainly for beginners, we want to highlight the creative part of (sharing) tech knowledge. It can be as simple as telling a story: To point out how thinking outside the box can kickstart innovation, we talk about an early programmer and how they approached it. But it could also be a story about how you yourself use code to do something that matters to you.

Story telling

Once upon a time, there was a girl. Her mother was a mathematician and her father was a poet. After a while, her mother got frustrated with the fathers artsy lifestyle and kicked him out, deciding that her daughter should only be involved with math and science, never with the arts. So the girl grew up to be a brilliant mathematician and scientist, but she always felt like there was something missing. One day, in her diary, she wrote:

„If you can’t give me poetry, can you give me poetical science?“

In 1835, she met an old man with an idea. He wanted to build a mechanical all-purpose computer, called Analytical Engine. It was inspired by the Jacquard loom, a machine that could quickly manufacture textiles. Our young woman was hooked. She expanded upon the scientific papers about the Analytical Engine and also translated them into other languages. True to her perspective, she noted:

„We may say most aptly that the Analytical Engine weaves algebraical patterns just as the Jacquard loom weaves flowers and leaves.“

Her name was Ada Lovelace and she is considered the first programmer in history.

Tangibility

How do you explain what coding entails? We’ve already pointed out the creative part within story-telling, but it’s also about being very exact, right? Beginners get frustrated when they miss punctuation marks or words of which the purpose is yet unclear. Additionally, coding is also about thinking in small algorithms/steps, adding them together to get a proper result.

One of my favorite ways to turn this into an experience detached from the computer is to turn myself into a human computer and ask learners to give me instructions on how to make a cheese sandwich. I actually lay out a bread knife, cheese knife, butter knife as well as bread, butter and cheese on a table in front of me. Depending on group size and age / previous knowledge, I ask people to give me single instructions – one instruction per person, one after the other – in order to make a sandwich. Trust me, every single instruction will be easy to misinterpret: „Take the knife“ will lead to a „Can’t find knife“ because there are three different ones. „Take the bread knife“ will lead to me (carefully) grabbing it by the wrong end because it was not specified where to grab it. I adapted this idea from a Computer Science lecture at Harvard but there are also other great examples.

Thus, we’ve created a memorable situation that was fun yet a teaching moment. It’s something you can reference whenever someone runs into those punctuation-mark-type of mistakes. And it gives your learners something very tangible that they, too, can use now.

Avoiding Jargon

Moving on to another thing that makes beginners wonder – the difference between Ruby and Ruby on Rails. It’s something that most programmers know, but how does one explain it to a beginner? This is my approach: While we’ve used human speech in the sandwich example to give instructions, we can’t really do that with computers yet. Ruby is one of the many languages that we can write instructions in so that machines can process them. And Ruby has a specific purpose: it’s used for logic. But there are many other languages, for similar or different purposes. Think of human languages: You usually wouldn’t use academic writing to make poetry and vice versa.

So with Ruby, we do some very specific things: we can use it to modify data, such as counting the amount of hearts under a tweet or taking that tweet and deleting it. However, if we want to remember all this, we need a language and a space to save the information. And we will need another language to show this information well-structured, on our computer.

When all of these different languages work together, we have created a proper program. But now it’s not only the Ruby language that we use, we combine different languages and call that Ruby on Rails, because Ruby gets a lot of help.

So, I haven’t told you anything new here, but I’ve managed to avoid most of the jargon – because that’s what overwhelms new learners most of the time. The deeper people dig into a topic, the more we can use jargon – but for explaining a larger context for the first time, avoiding all jargon is my creative challenge for you!

Metaphors

And then there is this concept that Rails uses – the Model View Controller. How do you explain that? I’ll use the metaphor of a café.

Basically, we have the counter where you, the customer, can have a look at the menu and choose what you’d like. That’s our view. We have the controller who will take your order and pass it on to the person who can actually make it. And that’s the model. The model person can check if the order is legitimate, grab all the necessary things from the cupboard (or database), prepare your order and pass it back to the controller – who will then pass it to the counter for you. There is a lot more to this metaphor and I bet you’re already inspired to create your own version. That’s cool, because metaphors are not a one-to-one representation of what we are explaining, but they can help to grasp a general overview of the landscape and offer a way to talk about things other than in tech terms.

Finding pairs and puzzling it out

As with any new topic we dive into, there will be specific vocabulary that learners will eventually need to remember. To support this process of memorizing, I use two different methods. For command line terminology, I bring cards with different commands and cards with their meaning. I lay them out in front of a group of maximum five people and ask them to discuss how they would sort them in pairs. Then, they actually sort them and we’ll check together if that makes sense.

For memorizing the basic structure of methods, if/else statements or loops, I write some simple examples on paper and cut them apart. Learners then get to puzzle those pieces back together – in small teams, so that they discuss their solution, too.

Behind the curtains

These were just a few examples of the methods that I use. There are many more and I encourage you to invent your own or check out what other people are doing. And whatever you’re doing, keep the phases of input to a maximum of twenty minutes. Then, give learners a chance to play with the information that was presented to them. Such play can, for example, be a pairing / puzzling session like the one I just described. After all, doing is what helps learners remember best, followed right by speaking about it! The nice part about this is that you as a teacher/mentor/coaches don’t have to do all the work and all the talk – and you’ll get to go home without that croaky voice. Enjoy!