How to Approach a New Programming Language - A World Language Student's Perspective

I didn't touch my first programming language until I was 23 years old. A decade prior, I had started learning my first world language. I would go on to find that language-learning is a matter of understanding a complex system. It's only easy if you understand how the pieces fit together to form the whole. Once you see the patterns that make the system work, the individual pieces just "click" together.

I spent 6 years of classroom time studying Spanish and 100 days living in Spain practicing it with native speakers. I spent another 4 semesters learning Japanese. I strongly believe that programming languages have a lot in common with world languages, and that's what I'd like to share here in case it might benefit a struggling student.

In Spanish, things didn't make sense as much until we got to conjugating verbs. Nobody likes those verb tables, except apparently me. If you took a language class, you'll know what this is:


These tables, to me, represent the simplicity and elegance of language. If you look at every aspect of a language, there are rules. If you follow those rules, your message makes sense to other people. If you don't follow those rules, your message only makes sense to you. We want people to understand us, so our job as language students is to internalize the rulebook so our messages naturally follow the rules. That's what it means to achieve native fluency in a language, be it Spanish or JavaScript.

Verbs are actions, right? I compare Spanish verbs to JavaScript functions. They both communicate an action, but instead of telling a person that we're going to write a blog post, we're telling the computer we want to log a message to the console. These are just simple examples, obviously, but for the message to be communicated, we need to use the correct syntax. In order for us to do that, we need to understand what the rules are for the individual parts:

For the verb:

  1. Infinitive (escribir = to write) is a regular -ir infinitive, and those have their own rules
  2. Conjugation needs to match correct person (1st, 2nd, 3rd)
  3. Conjugation needs to match correct quantity (singular, plural)
  4. Word needs to go in the correct place for a verb within the sentence
  5. The 'r' needs to be a "tap" r sound if you want native pronunciation, and the vowels need to be the Spanish "e" and "i" sounds

For the console logging function:

  1. console.log() takes an argument
  2. That argument can be any object
  3. Object needs to compile to the thing you're trying to display
  4. This function needs to go after the object you're trying to display or it won't know what object you're referring to
  5. Semicolon is optional, lowercase, parentheses, and period are all required

As you can see, if you follow all of these rules, you will have a high chance of success communicating your message.

What intimidates students who are new to world languages or programming languages is actually the same thing. Except for the unfair misconception that you need to be a math wiz to be good at programming, the primary concern is the complexity.

Sure, the idea of talking to strangers comes exclusively to world languages, and you might not like it when a computer throws an error at you, but ultimately those could be tolerable if we knew we had a guarantee that we'd reach an understanding of the language at some point. People are willing to tolerate a certain amount of struggle if they know there is a reward coming at the end.

Complexity doesn't have to be a bad thing, though. Complexity is good because it means we won't be limited by what we can do with the language. We need our languages to be complex in order to build messages and systems that are capable of accomplishing complex tasks. Understanding that complexity and internalizing the rulebook is simply the responsibility of someone who wants to wield the power that complexity has to offer, and it is very manageable, even if time-consuming.

These are my recommendations for a student who wants to approach programming languages like I approach all the languages I want to learn:

  1. Gather your fundamental building blocks and study the rules for using them
  2. Seek and take note of patterns, attempt to recreate these patterns in new situations
  3. Fail fast, fail early --> learning what doesn't work is just as important as learning what does work
  4. Don't focus on memorizing individual pieces and phrases so much --> if you can rely on a pattern to remind you of parts of the language, remember the pattern instead. You want to be able to generate new language that works, not be reliant on memorized phrases that worked in the past
  5. Give yourself time --> if you rush, you risk taking shortcuts. Internalizing long-term gratification will set you up for success and allow the process to be fun

I hope this makes sense. Language-learning is a lifelong passion of mine, and I don't draw a distinction between programming languages and world languages. They are all systems with rules that serve a purpose. Our job is to become adept at using those systems to solve real-world problems.

Go learn that language and start solving some problems!