"That along with the news that Twitter has hired 25 more employees kinda tells that Java's code base is practically more maintainable than equivalent Ruby code"<p>Uhh if you need 25 more people that tells me that your code is less maintainable and you're writing much more of it. No one has ever debated that in raw execution speed Java is faster, the problem is that most startups have plenty of CPU and few devs.<p>Twitter really did things ideally, start on a rapid dev platform and then port to a faster platform after acquiring the userbase and capital infrastructure that makes such a decision make sense. I'm not sure that if I was working on the JVM that Java would be my language choice, I'd probably use Mirah/Clojure/Scala.<p>The extra 25 devs are probably to ensure T2EE (Twitter 2 Enterprise Edition) compliance and refactor their POROs (Plain old ruby objects) to work with their ETB middleware. /snark
Once you increase the scale sufficiently, it's more cost effective to hire a team that makes the code run faster rather than add large expensive servers. This is what's happening now at Twitter.<p>It's not that Java is now absolutely 100% better than Ruby on Rails, it's just that Java is better for a site of that scale.
Twitter is beyond the scale of most businesses. This -- whether Scala or Java or PhP or RonR or Python -- is the best choice for our code base generating millions of hits per day is a problem many of us would love to have!
I have no insight into Twitter's decision making, but the reason I recommend Java over the other popular languages comes down to readability and maintainability. In my experience the dynamic-ness of the language begins to work against maintainability and readability after a while, especially after the original designers hand off the project to other programmers. Most language communities have built over time best-practice guidelines for readability and avoiding common bugs. But I think Java's age and enterprisy culture have allowed it to evolve stronger guidelines (see Joshua Bloch's Effective Java), and it's limited flexibility make it easier to maintain.<p>If you are in a highly competitive startup environment where break-neck execution for the next 6 months to a year is a matter of survival then Java might not make sense, but that doesn't describe most projects.
This isn't a knock against Ruby. Java and Ruby are designed to solve different sorts of problems (though there is a lot of overlap). Twitter is not in the overlapping region.
Twitter is well known for using Scala. Although the article says Java, I'd like to know if this is the case (i.e. no Scala) or a simplification.<p>I've done more Java programming than a man ought, and now a fair bit of Scala. The JVM is fast -- far faster than the Ruby/Python/PHP VMs. Harnessing that power has been an issue, as Java is so inexpressive. I find with Scala I can write code as quickly as in any other language I've used. It makes a great combination -- code quickly and get quick code -- and as a result I don't see any use for RoR or other interpreted frameworks in my coding.
3x faster for the pain of Java? I'll stick with Rails until I have enough money to pay people to migrate for me.<p>edit:<p>><i>That along with the news that Twitter has hired 25 more employees kinda tells that Java's code base is practically more maintainable than equivalent Ruby code - at least when the code base is huge and the team size is large.</i><p>What? How does hiring more employees imply something is <i>easier</i>?
Interesting why they chose Java instead of Scala for this move. The last time they moved off Ruby they moved to Scala, not Java. Anyone at Twitter want to comment?
gah, this again eh. Friday's news. This is a pretty unique/upper tier end of the spectrum problem. They needed to be able to cope with the ridiculous amount of realtime indexing and searching going on around the SEARCH stack, so ok, Netty etc. Not really anything about abandoning Rails etc.