Japanese grammar is famous for being so out-of-order compared to English. Or is it the other way around? Maybe English is the out-of-order grammar! ;) Just for fun, let’s imagine WWII turned out drastically different, computers were invented in Japan, and they got to make up all the syntax. What would a typical programming language’s syntax structure look like? (Of course, this is mostly fun speculation ;) who knows what the real answer would be!)

Conditionals

The “if…then” variations found in almost every high level programming language would be ordered differently. There are various ways to express Japanese conditionals (just as there are in English), but unlike English, they don’t put the conditional marker before the hypothesis, they put it after the hypothesis: instead of “if it rains I’ll go out”, it’s more like “it rains COND I’ll go out”. Interestingly, this is actually closer to the notation used in (Western-invented) mathematical logic: “rains->go out”.

The read test of a conditional syntax comes when the hypothesis gets complicated and the conclusion becomes multi-line. Here’s what an example might look like (syntax is modified from C):

(weather == WxRAIN || weather == WxDRIZZLE) ->
{
  (have_object(“rain gear”))->
  {
    grab(“rain gear”);
    wear(“rain gear”);
  }
  open_object(“door”);
  walk_through(“door”);
}
else
{
  stay_in(“house”);
}

Verb-Object Order

English is SVO (“subject-verb-object”), meaning the verb usually comes before the object, as in “cats eat fish”. Japanese is SOV (“subject-object-verb”), meaning the verb comes last, as in “cats fish eat” (like Yoda-talk). No doubt, this would influence the order of commands. Modifying the above example:

(weather == WxRAIN || weather == WxDRIZZLE) ->
{
  ((“rain gear”)have_object)->
  {
    (“rain gear”)grab;
    (“rain gear”)wear;
  }
  (“door”)open_object;
  (“door”)walk_through;
}
else
{
  (“house”)stay_in;
}

Ambiguity and Context

Japanese is famous for omitting things which are clear by context. The conversation fragment: “I came. I saw. I conquered.” would become: “I came. Saw. Conquered.” You can “kind of usually sometimes sort of” assume that if the subject is omitted, it’s understood to be the last subject which was specified. The same goes for objects, to a lesser extent. Here’s the above program fragment modified for ambiguity and context:

(weather == WxRAIN || == WxDRIZZLE) ->
{
  ((“rain gear”)have_object)->
  {
    grab;
    wear;
  }
  (“door”)open_object;
  walk_through;
}
else
{
  (“house”)stay_in;
}

Disjunctions (“Or”)

It’s a little weird the way the Japanese do disjunctions. Instead of “A or B”, they might say “A ka B ka”. The “ka” here is the question-indicating particle, so it might be built into the programming language as “A? B?” If we modify our bastardization of C accordingly, we get (only the first line is changed):

(weather == WxRAIN? == WxDRIZZLE?) ->
{
  ((“rain gear”)have_object)->
  {
    grab;
    wear;
  }
  (“door”)open_object;
  walk_through;
}
else
{
  (“house”)stay_in;
}

And please, don’t even make me think what treatment XOR would get! ;)

Politeness Levels

Another thing the Nihonjin are famous for is the high amount of attention they pay in their language to politeness, deference, and etiquette. (Actually, it’s kind of misleading to pretend that Japanese is unique like this. We do the same in English– you don’t talk the same to your boss as you do to your girlfriend! It’s just we don’t “see” it in English because we’re native speakers, and we don’t “see” it very clearly in other European languages because they way they do it is so similar to English. The real reason Japanese seems so politeness-obsessed is just because it’s politeness-obsessed in a different way than English.)

Let’s pretend that the code we’re writing is going to be read by the president of the company!

(weather == WxRAIN? == WxDRIZZLE?) ->
{
  ((“honorable rain gear”)have_object)->
  {
    grab please;
    wear please;
  }
  (“honorable door”)open_object please;
  walk_through please;
}
else
{
  (“honorable house”)stay_in please;
}

And last but not least!

Don’t forget, Japanese code would be written from the top to bottom, from right to left!

} {e}       {(
   l         w
 ( s w(}  {( e
 ” e a”    ( a
 h   lh wg ” t
 o   ko er h h
 n   _n aa o e
 o   to rb n r
 r   hr    o  
 a   ra pp r =
 b   ob ll a =
 l   ul ee b  
 e   ge aa l W
     h  ss e x
 h    d ee   R
 o   po ;; r A
 u   lo    a I
 s   er    i N
 e   a”    n ?
 ”   s)       
 )   eo    g =
 s   ;p    e =
 t    e    a  
 a    n    r W
 y    _    ” x
 _    o    ) D
 i    b    h R
 n    j    a I
      e    v Z
 p    c    e Z
 l    t    _ L
 e         o E
 a    p    b ?
 s    l    j )
 e    e    e  
 ;    a    c -
      s    t >
      e    )  
      ;    -  
           >  

FURTHER READING

Eleven Surprising Things about Japanese
Japanese Conditionals
The Adverb Model of Japanese
Teach Yourself Esperanto
Engrish

Discuss this article in the Article Forum.