Skip to content

Even more than Polyglot programming.

January 22, 2008

I recently attended the second installment of the CodeMash conference in Sandusky, Ohio where one of the three great key note speakers was Neal Ford. Neal introduced the audience to the notion of Polyglot Programming. Polyglot Programming is just a phrase for something that we all do sometimes, but don’t always realize we are doing it; programming in more than one language within the same context.

Even though most programmers, especially of the web variety, are familiar with this notion it was important that Neal organized some thoughts and observations about it. I think that the same programmers who realize they commonly use, for example, HTML, XML, JavaScript, and Java all in a single JSP page, tend to try hard to keep those languages separate abstractly. A common JSP will be organized into clumps of the various languages so as to aid in understanding.

After hearing Neal’s speech it occurred to me that the separation of languages we force ourselves to do is really unnatural. Writers don’t do this with the written language because it is too restrictive. Historians and journalists will often freely mix philosophic prose with cold hard statistical facts for example. And, even more compelling, the best writers of literature will weave phrases of a foreign language poetically into their works for greater effect.

Although there are many more, my best example right now is the book War and Peace by Leo Tolstoy. In War and Peace Tolstoy frequently inserts words and phrases from French and German. This tactic is not the device of arrogance or pedantic, but an effort at being as expressive and effective in language as possible.

Tolstoy mixed languages because he understood that sometimes a language can express something more effectively, expressively, succinctly, etc… than other languages. And Tolstoy was not the only author to mix languages. Mixing languages that way is just another literary tool that a good author will use if necessary. To enrich this point consider that Tolstoy wrote War and Peace in Russian, with the mixed in French and German. I don’t know any Russian, so I read the version translated into English. Despite the translation of the Russian into English, the phrases that Tolstoy inserted from languages other than Russian were not translated to English! That’s important because it signals a definite importance for those pieces of the text.

I think there is tons more to chase after in this topic. We are not at the point in Software Engineering where we can so easily mix Ruby and Lisp and HTML like Tolstoy mixed Russian and French and German, but, we’re moving in that direction. The plethora of languages that now run on the JVM is a good start and I hope that trend continues.


From → Uncategorized

Leave a Comment

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your 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 )

Connecting to %s

%d bloggers like this: