How learning a foreign language helps you learn to code

My obsession with foreign language had a lot to do with it.

I grew up in Tampa, a beautiful city on the west coast of Florida with a rich Hispanic heritage.

My ancestry is Scotch-Irish and my parents moved to Tampa around 30 years ago from North Carolina.

My father worked in the famous Columbia restaurant where I remember eating chicken and yellow rice while watching flamenco shows at a young age.

Flamenco show at the Columbia Restaurant.

Impressive and intense.

Credit to columbiarestaurant.

Many of my friends in school grew up bilingual.

I heard them speaking Spanish with their parents at pick-up time.

It always fascinated me how they could communicate between themselves without me understanding.

It was a certain power I didn’t have.

It was like magic.

Moreover, my best friend was Brazilian.

When he spoke to his family in Portuguese, even my Spanish-speaking friends couldn’t understand.

I remember promising myself in the 6th grade that one day I would be trilingual.

My dream was to wield the magic of language.

Fast forward about 15 years.

I had accomplished my goal.

I studied Linguistics, Spanish, Portuguese, Latin American Studies, and Teaching English as a Second Language at the University of Florida (GO GATORS! ????).

I spent time in Sevilla, Barcelona, and Rio de Janeiro during my language studies.

As a post-graduation trip, I hiked up Machu Picchu in Peru.

My knowledge of foreign languages opened up so many doors for me.

I connected with people from completely different cultures, regions, and perspectives.

I chowed down on local delicacies: alpaca burgers, cow hearts, fried guinea pig, seared rabbit, roasted chicken hearts, and more.

Brazilian chicken hearts.

SO GOOD.

Credit to Brazilian Chef.

But ultimately, I decided not to pursue a career in foreign language education like I had planned.

The reasons behind that decision are many, and for a different post entirely.

I ended up as a software developer, and I couldn’t be happier.

However, there was a lot of self-doubt along the way because I made such a leap career-wise.

As it turns out, though, learning two foreign languages in the past greatly benefitted me as I learned how to code.

I argue that anyone who has learned a foreign language is uniquely suited for learning how to program.

There are a lot of similarities between learning a human language and a programming language.

I think that these similarities can be boiled down to two main points:The learning processThe learning mindsetThe Learning ProcessThe processes through which you learn a human language and a programming language are remarkably similar.

You have to pass through similar steps in the same order to learn them effectively.

Step 1: Learn the Building BlocksWhen you’re learning a foreign language, you start with memorizing vocabulary words.

Vocabulary words are the building blocks of the language.

You learn the words that are used most often and the words that form the basics of the human experience: names, numbers, colors, family members, days of the week, months of the year, etc.

You don’t know how these words fit together, but you learn them and their definitions.

You may even sing songs or chant them in order to memorize them.

In programming, there is a similar step.

How does the language handle numbers?.How do you perform operations on those numbers?.How do you declare a variable and store its value?.How do you write, “Hello, world”?Step 2: Put the Blocks TogetherThe next step in learning a foreign language is putting words together.

There’s no real understanding of grammar yet, but you start to understand that words go together to create more complex meaning.

For example, Me llamo Dylan means My name is Dylan.

At this point in my journey in Spanish I wouldn’t understand that me is a reflexive pronoun that is attached to the verb llamarse, and I wouldn’t understand that llamo is the first person present conjugation of llamarse, but I would know that the way to say your name is to say the phrase Me llamo [name].

Similarly, while beginning to learn JavaScript, you may not fully understand why the following code is written how it is, but you’ll understand that it returns the values in the array less than 50:let prices = [25, 30, 80, 90, 100]prices.

filter(price => price < 50)// returns [25, 30]You could have written the above code differently.

I didn’t have to write it with an arrow function.

But at this point, those kinds of subtleties aren’t the most important thing.

The most important thing is realizing that you can manipulate arrays through functions.

Step 3: Learn SyntaxThis is the turning point in language learning.

This is where you learn how to construct meaningful ideas by using grammar to string together ideas.

You learn how to conjugate verbs.

You learn the difference between tenses.

You learn purely functional words — words that don’t really mean anything on their own, but help us connect phrases and ideas.

The Spanish word que is a good example.

It is often used as a subordinating conjunction, a word that connects clauses together.

Grammar is a hard part of learning a new language because it is more abstract than learning words that have real-life references.

mesa in Spanish is table.

That’s easy to picture.

ni siquiera is a phrase that means not even, like “I wouldn’t date him not even for a million dollars.

” How do you picture the idea of “not even”?.But it’s an important connector put into a specific place in the sentence to determine a relationship between the desire (or lack thereof) to date him and the idea of one million dollars.

My favorite example of learning syntax in programming is this in JavaScript.

It’s a confusing topic at first.

Why are we writing this before function calls?.What does this mean?.Why is it called this?.Keywords like this are the grammar of programming.

this accesses the context object in which the current code is executing.

It don’t necessarily mean anything on its own, but it helps us connect parts of our code.

It’s worth mentioning that grammar varies wildly from one human language to another.

That goes for programming languages, too.

Just imagine the differences between object-oriented languages and functional languages.

Also strongly-typed and weakly-typed languages.

They look and act differently.

Step 4: Speak Like a NativeAt this step you can get the message across, but it sounds weird.

People can tell you’re not a native speaker.

Maybe you have a heavy accent.

Maybe your grammar makes sense logically, but it’s just not the way people would normally express the idea.

Working on this step is the most rewarding but also the most difficult.

Language students pride themselves on sounding native.

Your accent is a big part of this, but there are a lot of other things to keep in mind.

Using idiomatic phrases is one.

Word choice is another.

Register — when to be formal, when to be casual, when to be vulgar — is another complicated part of sounding native.

When I was studying abroad in Rio de Janeiro, my host mother was showing me around town on the first day.

I lived in Copacabana three blocks from the beach.

I was thinking how beautiful it would be to watch the sunset from the beach, but I didn’t know the word for “sunset!” So I asked instead, At what time does the sun disappear?.Horribly formal, very stilted way to ask about the sunset.

But the way I asked was completely grammatically correct, so she shot me a weird look and answered.

Then politely provided me with pôr-do-sol as the word for sunset.

Sunset over Copacabana beach in Rio de Janeiro, Brazil.

Credit to Shutterstock.

Coding is the same.

You have many options (in some languages more than others) to express an idea.

There is a creative — maybe even artistic — side to coding due to the flexibility with which you can accomplish your goals.

But sounding native in code is important, too.

I learned early on that your code should be readable by other developers.

No one wants to read code that is improperly indented or where there’s weird unnecessary whitespace.

People want logically organized code.

People want variable names that make sense.

People want helpful comments.

Similarly, following conventions is important.

Can you use divs to make headers and footers for a page?.Yes.

But why would you?.HTML5 gave us header and footer tags to help with SEO, accessibility, and readability of code by other developers.

If you continue to use divs, the code will execute fine, but people will raise an eyebrow at it.

The Learning MindsetIt takes a certain mindset to excel as a language student.

You have to be childlike: hungry to understand the world around you, willing to accept new information as you discover it, and unafraid of making mistakes or looking silly.

Learning a foreign language is frustrating because you have to learn certain basics or rules of the language then later find out that there are a ton of exceptions to those rules.

For example, in Spanish you usually put the adjective after the noun.

So pretty woman would be mujer bonita, where “bonita” is “pretty”.

This is awkward for English speakers learning Spanish because in English you generally put the adjectives before the nouns.

As it turns out, though, there are plenty of instances in Spanish where the adjective goes before the noun!.In fact, some adjectives you can put either before or after the noun, and the placement changes the meaning of the sentence:Mi amiga vieja // My old (in terms of age) friendMi vieja amiga // My old (you have known her for a long time) friendA successful language student is able to work through the frustration that comes along with these paradigm shifts.

Instead of thinking, “What do you mean adjectives can come before nouns?!. More details

Leave a Reply