I was a full time Java developer for over ten years (though I’m very
happy that that is no longer so!).
Here are my feelings about it:
So many Java developers have never worked with a scripting language.
Using a scripting language can make automation of some tasks feasible
where using Java instead would be prohibitively complex and time
consuming.
Using a scripting language that runs on the JVM (JRuby, Groovy, Clojure,
and others) provides easy interaction with a Java product’s code. This
can be handy for:
- unit testing (e.g. with rspec, minitest)
- providing an interactive shell (e.g. irb, pry) for that code. Having
an interactive shell to exercise Java code can be mind-blowing for
someone whose interaction with their code has been limited to an IDE and
the OS’ command line.
- RDBMS manipulation - for interacting with RDBMS’s, using JRuby and
the Sequel gem can make DB interrogation and manipulation way, way
simpler than in Java.
4…n) …
Ruby is a great language. JRuby is the only Ruby implementation that
can run in the same process as Java code (the JVM). So JRuby offers the
intersection of those three very valuable attributes — being a scripting
language, Java interoperability, and being the highly productive
language that we know and love.
Many times a project is mandated to be written in Java, but it’s really
only important for the production code that the application runs; other
things, such as unit tests, admin scripts, etc., can be written in
another language.
I am convinced that there is a gold mine of functionality that can be
added to Java dev teams using JRuby. Unfortunately, the mindset of most
Java developers seems to be rather bigoted against JRuby (just as so
many Ruby developers are bigoted against Java). So it’s a people
problem (as usual) that stands between us and greater value.
Some will complain that the effort of learning another language for this
is prohibitive, but my response is that if a team’s toolbelt doesn’t
include any scripting languages, then the team is functioning with a
hand tied behind its back.
By the way, I used to give a JRuby presentation that included addressing
this question (see
JRuby - The Synergy of Ruby and the JVM - Speaker Deck).
It’s a little dated, but most of it is still accurate.