TITLE: JRubyConf 2012: Keynote Address on Polyglot Programming
AUTHOR: Eugene Wallingford
DATE: May 24, 2012 3:05 PM
DESC:
-----
BODY:
JRubyConf opened with a keynote address on polyglot programming by
Venkat Subramaniam.
JRuby is itself a polyglot platform, serving as a nexus between a
highly dynamic scripting language and a popular enterprise
language. Java is not simply a language but an ecosphere
consisting of language, virtual machine, libraries, and tools. For
many programmers, the Java language is the weakest link in its own
ecosphere, which is one reason we see so many people porting their
favorite languages run on the JVM, or creating new languages with
the JVM as a native backend.
Subramaniam began his talk by extolling the overarching benefits of
being able to program in many languages. Knowing multiple
programming languages changes how we design software in any language.
It changes how we think about solutions. Most important, it changes
how we perceive the world. This is something that
monolingual programmers often do not appreciate. When we know
several languages well, we see problems -- and solutions --
differently.
Why learn a new language now, even if you don't need to? So that
you can learn a new language more quickly later, when you do need to.
Subramaniam claimed that the amount of time required to learn a new
language is inversely proportional to the number of languages a
person has learned in last ten years. I'm not sure whether there is
any empirical evidence to support this claim, but I agree with the
sentiment. I'd offer one small refinement: The greatest benefits
come from learning different kinds of language. A new
language that doesn't stretch your mind won't stretch your mind.
Not everything is heaven for the polyglot programmer. Subramaniam
also offered some advice for dealing with the inevitable downsides.
Most notable among these was the need to "contend with the enterprise".
Many companies like to standardize on a familiar and well-established
technology stack. Introducing a new language into the mix raises
questions and creates resistance. Subramaniam suggested that we back
up one step before trying to convince our managers to support a
polyglot environment and make sure that we have convinced ourselves.
If you were really convinced of a language's value, you would find a
way to do it. Then, when it comes time to convince your manager, be
sure to think about the issue from her perspective. Make sure that
your argument speaks to management's concerns. Identify the problem.
Explain the proposed solution. Outline the costs of the solution.
Outline its benefits. Show how the move can be a net win for the
organization.
The nouveau JVM languages begin with a head start over other new
technologies because of their interoperability with the rest of the
Java ecosphere. They enable you to write programs in a new language
or style without having to move anyone else in the organization.
You can experiment with new technology while continuing to use the
rest of the organization's toolset. If the experiments succeed,
managers can have hard evidence about what works well and what
doesn't before making larger changes to the development environment.
I can see why Subramaniam is a popular conference speaker. He uses
fun language and coins fun terms. When talking about people who are
skeptical of unit testing, he referred to some processes as
Jesus-driven development. He admonished programmers who
are trying to do concurrency in JRuby without knowing the Java
memory model, because "If you don't understand the Java memory
model, you can't get concurrency right." But he followed that
immediately with, Of course, even if you do know the Java
memory model, you can't get concurrency right. Finally, my
favorite: At one point, he talked about how some Java developers
are convinced that they can do anything they need to do in Java,
with no other languages. He smiled and said, I admire Java
programmers. They share an unrelenting hope.
There were times, though, when I found myself wanting to defend
Java. That happens to me a lot when I hear talks like this one,
because so many complaints about it are really about OOP practiced
poorly; Java is almost an innocent bystander. For example, the
speaker chided Java programmers for suffering from
primitive obsession.
This made me laugh, because most Ruby programmers seem to have an
unhealthy predilection for strings, hashes, and integers.
In other cases, Subramaniam demonstrated the virtues of Ruby by
showing a program that required a gem and then solved a thorny
problem with three lines of code. Um, I could do that in Java, too,
if I used the right library. And Ruby programmers probably don't
want to draw to much attention to gems and the problems many Ruby
devs have with dependency management.
But those are small issues. Over the next two days, I repeatedly
heard echoes of Subramaniam's address in the conference's other
talks. This is the sign of a successful keynote.
-----