The similarities between learning a new language and coding
The similarities between learning a new language and coding

Broadly speaking, both human languages and programming languages use vocabulary, syntax, and semantics to enable communication. However, their functions and purposes are vastly different: while JavaScript powers websites and commands computers to perform specific tasks, Arabic lets you chat with friends and opens up a world of literature. Despite these differences, if you have experience learning human languages, you might have a head start in learning how to code.

Thinking in a Different Way: Flexibility

Learning another human language forces you not only to restructure your thoughts based on the workings of the language but also on your accumulated knowledge of it. Additionally, there are different ways of phrasing your ideas that will lead to the same desired outcome.

Let’s imagine that you want to use your target human language to find out what someone else’s favorite Pokemon is. If you already know how to conjugate the verb “to like” in the second person, you could ask them: What Pokemon do you like the most? But if you don’t know this conjugation yet, you’d need to find a workaround, such as: What’s your favorite Pokemon? Both questions will yield the same answer, but they are worded differently based on your knowledge of the language.

This flexibility in thinking can be very helpful when trying to put your ideas into code. It allows you to explore different approaches, and adapt to both the structures of the programming language and your current knowledge. 

For instance, below are two pieces of JavaScript code that will lead you to the same answer, but with different methods based on your prior learning:

If you’ve learned functionsIf you haven’t learned functions

Logic in Language, Logic in Code

Coding is a constant game of logic which can be reminiscent of dealing with the complexities of human language structures. 

For instance, human languages frequently use logical constructs, such as conditional statements, to express reasoning and consequences. Similarly, JavaScript uses these resources (e.g., “if-else” statements) to direct the flow of code execution.

Consider this parallel:

English (first conditional)JavaScript (“if-else” statements)

Note: If not only the logical structure but also the vocabulary itself seems similar to you, it’s because computer languages use reserved words, generally in English, to facilitate programming comprehension.

Picking up Patterns, and Detective Work

Both human and programming languages tend to heavily depend on pattern recognition and attention to detail.

Pattern Recognition

To give you an idea, mastering Japanese kanji (characters adapted from Chinese) isn’t just about memorization —it’s also about spotting patterns in how characters are formed and combined with one another to create words. 

For instance, the radical 氵 is often used in kanji related to water, as evidenced by words such as: to cry (泣く – naku ), sea (海 – umi), and pond (池 – ike). Another example is the kanji 機 (ki), which is frequently associated with machines. This can be seen in words like airplane (飛行– hikouki), washing machine (洗濯 – sentakuki), and vacuum cleaner (掃除– soujiki).

The examples above showcase how learning human languages sharpens your pattern recognition skills, which can also be applied to coding. Pattern recognition in coding is about spotting elements or arrangements that you’ve seen before to make sense of programs, algorithms, and streamline problem-solving processes.

Attention to Detail

This skill is also developed during the human language learning process because, for example, even misplacing a single stroke of a kanji could change the meaning of your message or turn it into gibberish. Observe the kanji 人 (hito) for “person” and 入 (nyu) for “enter.”  While they are very similar, subtle distinctions exist and your ability to discern them can also be an asset in coding.

Like a misplaced stroke in kanji, forgetting punctuation in JavaScript can mess up the syntax, causing weird behavior in your program. Look at the following example, where the lack of few commas in the list of fruits within the brackets causes an error:

Without commasWith commas

So, it’s safe to say that understanding the intricacies of kanji, the Thai script, conjugations in Spanish, compound words in German, grammatical cases in Turkish, or any other human language, gives you the upper hand in tackling various aspects of coding.

Communication Issues and Debugging

As a human language learner, you’ve most likely faced communication issues while speaking your target language. Maybe you’ve mistakenly said “estoy embarazada” (I’m pregnant, in Spanish) instead of “estoy avergonzada” (I’m embarrassed). This probably didn’t get you the reaction you were hoping for, and it potentially made you feel even more embarrassed. But, on a positive note, that reaction did help you identify the problem, make sense of it, and correct yourself.

Fixing such mistakes is surprisingly similar to debugging code. Just like resolving a communication mix-up, debugging code involves identifying the source of the error and fixing it.

Fortunately, human communication tends to be forgiving. However, as we saw before, small errors in coding can completely break the flow of the program, which emphasizes the importance of this skill you’ve developed to some extent by learning your target human language.

Consider the following example of buggy communication with JavaScript:

Did you spot the error? How would you go about debugging it? (Hint: it’s a spelling mistake.)

Persevere and Keep on Learning

Learning to code, like learning a human language, requires time and commitment. If you wouldn’t expect to become fluent in Swahili overnight, then don’t expect to code a full-fledged interactive website with JavaScript in under an hour as a beginner.

Additionally, like human languages, programming languages are diverse and have seemingly endless features. Just as there are various languages in the world and multiple dialects in Norwegian, there are various programming languages and multiple frameworks for each one.

Despite all this, you shouldn’t feel discouraged to code. Sure, there’ll be challenges along your journey, but your previous experience in human language learning will help you embrace the process and give you a head start in recognizing patterns, employing logic, debugging, and more!

If you are interested in programming, you can also have a look at why technical writers should learn docs as code.

Submit a Comment

Your email address will not be published. Required fields are marked *