Parallels Between Language and Computer Science

Makoto Ogawa is a former Morning Musume idol, who took a couple of years off of performing to go to New Zealand to learn English.  She recounted her experience in words similar to this (and I’m paraphrasing because I don’t remember them entirely):

I went to New Zealand to learn English, but in doing so, I found that I didn’t understand Japanese.  So I had to learn Japanese first.

As I’ve been thinking about how best for me to learn Japanese, I’ve been thinking deeply about the underpinnings of language, and I’m reminded of computer languages.  I know probably ten languages, and I’m proficient in probably five or six (though I’ve been out of practice in a few).  I guess this makes me a CompSci polyglot.  But I started thinking about the differences between computer languages.

Take these two examples:

#include <stdio.h>

void main(int argc, char *argv[]) {
 int i = 0;
 int result = 0;
 for (i = 0; i < 5; i++) {
   result += i;
 }
 printf("%s", result);
}

and:

result = 0
for i in range(0..4):
  result = result + i
print(result)

The first example is in C, the second example is in python.  Please excuse any syntax errors, I did not compile or run them.

In case you don’t understand programming, let me explain:  both of these examples will do exactly the same thing. (Possible syntax or logic errors notwithstanding).  Both will take all the numbers from zero to four, add them up, and print the result.  So if you look closely, you can see common syntax and structures.

But they are not the same.  Each language engenders specific design choices of the people who designed the language.  In the second example, for example, the indents are absolutely important.  If you do not put the indents in the code, it will not work.  In the first example, the indents are optional.  The important structures to serve the same function are the curly braces.  They both serve the same purpose, but the python developers wanted to enforce what they saw as good coding style, while the C developers wanted to… well, I’m not sure what they wanted to do.  I suspect they just had to come up with something and did.  There’s probably a historical reason for it.

But that makes my point for me:  the C developers were pragmatic, while the python developers enforced a particular cultural aspect through the use of language syntax.

What does this have to do with Japanese?  Or any other language, you may ask?

Well, think about the difference and similarities between Japanese and English.  We focus on the differences (and we’re right to), but there are many similarities as well.  They share specific parts of speech, even though the way one marks those parts of speech is different.  They share specific concepts, even though the words are different (“look” vs. 見, for example).  But they both share common human experience.  There is, generally, a one to one correspondence between concepts, just as there is generally a one to one correspondence between concepts in computer languages, with the only differences between the languages being esoteric, with a few fundamental cultural differences tossed in.

So what was Makoto Ogawa saying?

The trick to understanding a different language is to understand yours.  The reason being that once you know how yours works, the rest is, literally, just semantics.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s