I’ve been wanting to start a blog on dev.to for a while, but I wasn’t sure what I wanted my first post to be about. Then yesterday, my friend Cal Evans posted a tweet that got me thinking about a possible topic:
Earlier in my career, I taught Arabic in Chicago Public Schools. It was incredibly rewarding to teach middle school students who entered my classroom knowing nothing at all about Arabic, but who would then come back to me weeks later, excited to tell me about how they had overheard Arabic being spoken in their neighborhood and were able to join in on the conversation.
As I read Cal’s tweet, I realized that there are quite a few parallels between learning a programming language, and learning how to read, write, and speak in another world language.
In this post, I’ll share some of the techniques that I used as a world language teacher, which can be applied to the process of learning any programming language.
1. Focus on reading the language, in addition to writing it.
In the beginning stages of learning any type of language, it’s natural to want to focus on creating new content, whether that’s in the form of speaking words or writing new lines of code. However, part of developing your skills in any language is the process of balancing what you create with knowing how to read and interpret what others have put out.
As an Arabic teacher, one of the first phrases that I taught my students to say was “As-salaamu ‘alaykum” (peace be unto you). The appropriate response to this is, “Wa ‘alaykum as-salaam” (and unto you, peace). One of the lessons that I wanted my students to learn from this exchange was that in order to know when to say the second phrase, you have to be able to listen and recognize the first one. You can’t just go around saying “wa ‘alaykum as-salaam” out of context, when “as-salaamu ‘alaykum” hasn’t been said before it. (Well, you can, but you might get some strange looks.)
In other words, I made sure that my students were developing their skills in reading and listening to Arabic, to complement what they were also doing with writing and speaking.
It’s the same approach that you should take with a programming language. While you’ll certainly spend a substantial amount of time writing new code, you should also make sure that you learn how to read and interpret the code that other people have written.
For example, this can be helpful for times when you’re working with legacy code, and you need to try to understand the intent behind how and why the code was written, before you add in your own new lines.
Pair programming is another way to get more practice with this, since it makes the process of writing code more collaborative. Rather than reading only code that you have written yourself, pair programming can give you the opportunity to gain insights into the way that other developers think, and to get a sense of how they might choose to approach a particular problem.
2. Before reaching for something new, learn how to use the tools that you already have.
Of all the lessons that I took away from my Arabic professors in college and grad school, this is by far the one that I most wanted to pass along to my middle school students.
Before I started learning Arabic in college, I had studied Spanish for eight years, beginning when I was in middle school myself. However, even after all of those years, I never felt truly confident with speaking Spanish beyond a few simple phrases. I would always run to my dictionary or an online translation tool immediately upon getting stuck. If I didn’t know something, I would look it up.
I figured I would do the same thing when I was learning Arabic. I’ll never forget one day in class when I was trying to tell my professor about how I had gone to the grocery store over the weekend. I didn’t know the word for “grocery,” so I started looking through my dictionary to try to find it.
My professor gave me a strange look and asked me what I was doing. I explained that I needed a word, so I was looking it up. He stopped me and said, “No, Olivia, everything that you need is already up here,” as he tapped on his head. “Find a way to use the words that you already know.”
It was a struggle, because I couldn’t fall back onto my dictionary or online translation tool, but I somehow managed to make my way through that conversation! Even though I didn’t know how to say “grocery store,” I did know how to say “a store where I bought chicken and very, very cold milk” (ice cream).
The point here was that my overall message was still able to be conveyed, and the more that I used this strategy over time, the better I became at using problem solving skills when I couldn’t think of the correct word to say or write. When I became a teacher myself, I saw my students struggle just as I had done, but I reassured them that it was going to make them better communicators in the long run.
The same concept can be applied to programming languages. This isn’t to say that you should never look up documentation (because you absolutely should!), but rather, you should try to use the problem solving skills that you have whenever you’re trying to write or debug some code.
That might look like this:
- Which functions do I already know that I can put together to possibly achieve the intended result?
- What have I seen before that might be causing this type of error?
In other words, learn how to truly flex the tools that you already have at your disposal, before you try to add in something new that you’re completely unfamiliar with. It’s most likely going to feel difficult and frustrating at times, but trust me: It’s one of the best ways to learn how to master using the tools that are already in your toolkit.
3. Practice! Surround yourself with a supportive community.
In my classroom, I often taught students who were perfectionists, in that they never wanted to speak up until they knew that what they were saying was absolutely correct. I also taught students who actively participated, had fun with trying to pronounce the new and unfamiliar sounds, and made plenty of mistakes along the way.
Guess which students were the ones who were usually able to grasp the language concepts more quickly and accurately?
Arabic has a few guttural sounds that aren’t present in English, so the only way to master them is to keep practicing and trying. For example, it took me nearly two years to feel comfortable and confident with pronouncing the letter ‘ghayn in actual discourse, and not just in isolation.
As a teacher, a major part of my job was helping my students to feel comfortable with speaking up and practicing, so that I could commend them on what they were doing well, and also give them feedback on the specific parts of their speaking that they needed to improve.
This was possible because I established a classroom culture in which everyone was considered a learner, and I made it clear that it was not okay to make fun of each other for trying. No one gets it right on the first try, nor was that my expectation. Over time, the more that my students got to know me, the more I could tell that they were beginning to trust me and open up even more.
As you’re learning a programming language, you’ll want to take this exact same approach: Write new code, even if you know that it’s not going to be perfect. Make mistakes, view them as opportunities for growth rather than setbacks, and learn from them.
Most importantly, surround yourself with people who are supportive, trustworthy, and encouraging, like right here on dev.to. Other places where I’ve been able to make meaningful connections have been on Twitter, in local Meetup groups, and through conferences.
Whenever I find myself feeling unsure of a project that I’m working on, or if I need to bounce some ideas off someone, I’m starting to find a lot of value in connecting with my community, rather than keeping it all inside myself. This can be tough for me as an introvert, but so many of the concepts that I’ve learned have come as the direct result of me giving it an honest effort, and also being okay with asking for help when I need it.
If you’ve read this far, shukraan jazeelaan (thank you very much)! Feel free to find me on Twitter and send me an "as-salaamu ‘alaykum."
Top comments (2)
This is all really great advice. A lot of people don't think about it, but a very large part of how we learn a programming language is very similar to how we learn a natural language, and what programming languages we know can have just as much impact on how we think as what natural languages we know.
Thanks, Austin!