rc3.org

Strong opinions, weakly held

Why people are returning to Java

I am a huge fan of Ruby on Rails, but I was not terribly surprised to read that as Twitter’s code base has grown, they’ve found it more amenable to move to JVM-based languages for reasons having mostly to do with encapsulation. InfoQ interviews Twitter engineer Evan Weaver about how the company’s stack is evolving as they get bigger.

On one hand, they’re moving more services to the JVM for performance reasons. When they extract components from their main code base to optimize them, they generally migrate them to the JVM:

The primary driver is honestly encapsulation, so we can iterate faster as a company. Having a single, monolithic application codebase is not amenable to quick movement on a per-team basis. So when we decide to encapsulate something, then because of our performance concerns, its better to rewrite it in the JVM for most systems, than to write a new Ruby system.

They’re also finding the rigidity of the JVM useful for productivity reasons:

And the other half is that, as search has moved into a Service Oriented Architecture and exposes various APIs, static typing becomes a big convenience in enforcing coherency across all the systems. You can guarantee that your dataflow is more or less going to work, and focus on the functional aspects.

Those are the kinds of reasons why I could not imagine rewriting the main application I work on as a Ruby on Rails application. I’m surprised he doesn’t also mention the maturity and power of the tools on the Java side. Text editors like TextMate and Vim are great, but when it comes to navigating through a large, complex code base, you cannot beat the state of the art Java IDEs like Eclipse and IDEA.

Update: Edd Dumbill lists seven reasons you should use Java again.

7 Comments

  1. Have to admit, as much as I hate Java (mainly just the libraries), the lack of precise navigation/searching/etc available for “IDEs” for JavaScript is just killer. Sad. Assume it’s the same for other non-static-typed languages. It doesn’t have to be this way. But is. Grep is my best friend.

  2. Devdas Bhagat

    July 7, 2011 at 2:07 pm

    Twitter hired a bunch of JVM engineers some time ago. Obviously, they find Java more comfortable than Ruby.

    Again, they are using SOA (which I assume is being implemented with SOAP or equivalent). SOAP and Java are a good pair.

    OTOH, if they had been using simple named parameters and message passing, I suspect it would have been easier to stick with Ruby.

    Patrick, ack http://www.betterthangrep.com/

  3. SOAP?????? Please god no. I seriously doubt they or any other successful company is using SOAP for new code.

    JSON + REST, sure.

    I am back in Javaland after a sojourn with C# and some intensive JavaScript time. JS is good where it’s good, but nothing beats the Java tools. Yeah, it’s a pain in the ass to do some things in Java, but it usually turns out that it’s a pain in the ass to do them in whichever language.

  4. Java? Afaik they switched to Scala?

  5. Scott Reynolds

    July 8, 2011 at 7:04 pm

    They use Thrift, not JSON + REST or SOAP.

  6. Twitter is using a wide range of technologies to achieve whatever tool they need at various levels of their stack. Moving from a high velocity of market entry and definition to strong long lasting stability and mass marketing. If you’d like to pick out your personal attraction within that stack go ahead, you are largely missing the point.

    Put away the measuring tape…

Leave a Reply

Your email address will not be published.

*

© 2016 rc3.org

Theme by Anders NorenUp ↑