Is Ruby the new Java?

About eight or nine years ago, I first read about Java in Wired Magazine. At the time, I was mostly programming in Delphi, C, and, if I really had to, in Oracle Forms. It wasn’t altogether clear what role Java was going to play; any examples you ever saw were applets, doing image animations on a web page. I bought a book that promised to explain it all, but did little else but list the standard libraries api docs. Although over time, more and more people were saying Java was going to be the next great thing, I didn’t have a clue what to do with Java, there & then. (Until 2000, when I did my first web app with Java, with EJB’s, and started wondering why I had ever wanted to be a part of this next great thing).

Right now I’m having a strong feeling of deja vu. This time, it’s about Ruby. Everyone probably knows by now that Ruby is a scripting language, developed nine years ago in Japan, became very popular in the rest of the world in the last year or so. Recurring discussions on TSS revolve around the question if and when Ruby is to be preferred over Java, and if it will be the next great thing. Surely the language looks interesting enough, and so does the web framework, Rails. But in order to really get to know it, I have to use it in a real project, doing real stuff (I have not enough patience or spare time to just code something for the sake of it).

There’s several books written about Ruby, of which Programming Ruby comes recommended by Remco, my local Ruby guru (and by none other than Martin Fowler, I read at Amazon). Until now, I’ve done it the cheap way by reading Why’s (Poignant) Guide to Ruby. This free ebook explains the basics of the language in the form of a rather insane story, illustrated with equally wacko comic strips. It tries to offer memory aids through its story for Ruby’s language features. Unfortunately, most of these memory aids are so far-fetched that I’m having trouble remembering _them,_ let alone the language elements they’re supposed to remind me of. But it does make for entertaining reading, offering an easy introducting to Ruby.

2005-11-21. 5 responses.

Comments

  1. I am growing more and more tired of the comparison between Java and Ruby. They just don’t match.

    Java is this enterprise monster which is very much loved by large companies for being enterprise-ready, cluster-aware, high-end, re-usable, management-compliant, what-ever. And it is loved by ICT consultants because it mostly involves huge over-budget, running-along-deadline projects which will make them loads of money. Standards are developed through a process of guidelines, specifications and reviews. In the end it’s an OO language, unfortunately constrained by its popularity.

    Ruby is just another scripting language which was born from the hands of a guy in Japan out of boredom during the Japanese economic depression. Like lots of OSS projects its driving force is fun and it is fuelled by passion. Its libraries are mostly ad hoc and the best of them are incorporated into the core. It’s also an OO language, build to evolve.

    Besides being OO, Java and Ruby share passion. No doubt mister Gosling loves working on Java as much as Matz lovers working on Ruby. The problem lies in the passion of the developers using these languages, especially the Java developers. This love is fading and developers are looking at other languages to make their lives easier; first it was Python and now Ruby is the hip new thing.

    Love is fading because Java lags behind in programmer friendly features. C# showed a lot of uncovered area’s in Java years ago (end of 2002) and Sun just recently caught up with Java5 (mid 2004). Here recently is more than a year ago, which seems like centuries ago, but in Java’s case. Production systems running Java5 are still rare.

    It’s becoming harder and harder to develop software using Java without a fat IDE with plenty of plugins. Don’t get me wrong I love working with eclipse, it solves a lot of problems for me, especially in the area of refactoring code, but I draw the line at the need for code generation ranging from simple getter/setters to EJB’s and services. IMHO this just shows you platform is not flexible enough to solve your problem.

    Please stop comparing Java and Ruby! If you are worried about your knowledge being outdated soon, don’t be. COBOL still pays a lot of people’s bills and Java will do so many years to come. On the other hand, if you like programming and want to have fun doing it; learn new languages, at least one a year. And there’s a lot of cool stuff to choose from; Perl6, Haskel, Lua, C#, Python, IO etc.

  2. Remco, I really agree with most of what you’re saying. When I started programming a long time ago, I read somewhere that you should choose the programming language best suited for the job; and if you can’t find one, create a new language. While that may be a little uncompromising, I do agree with the general idea: don’t get stuck with one language, be flexible, be prepared to look into other languages. Which is precisely why I’ve been reading about Ruby. It’s just frustrating having to wait so long before you can actually apply this new knowledge to a real-world job.
    I’m not sure if I agree with your statement that people’s love for Java is fading. Just look at how much effort is put into open source Java projects, often by people who aren’t getting paid for it. Sure, the language may be developing a bit more slowly; but I have more faith in Java’s community process than in being dependent on the ideas of one single company or on a group of programmers who think backwards compatibility is for wimps.
    The reason I like Java so much is the lack of all too programmer friendly features. There’s seldom a language construct that requires you to stop and study the code (or worse, the language docs) to find out what it’s doing. After 3 years of having done no Perl programming, it’s a lot harder to re-read my old Perl code than it is to re-read old Pascal/Delphi code–and I haven’t done Pascal for 5 years now; that’s the difference (meaning, Java is more like Pascal in this).

  3. […] The battle of Ruby vs. Java is breaking loose big time. You haven’t heard? Seriously? Well, I’m not going to add yet another blog entry with a summary of the whole discussion started by Martin Fowler ; you’ll find an excellent summary on The Farm (but don’t stop there; you don’t want to miss, for example, Elliotte Rusty Harold discovering the versatility of Ruby’s Array class). My local Ruby guru advised me earlier on against comparing Ruby with Java, and I agree: you should use each language where it’s best suited. […]

  4. […] Like I wrote earlier, it’s frustrating to learn a new language when you don’t get to use it straight away. So I’ve come up with 10 creative ways that will get you started today with making big money (or fame) with your newly acquired Ruby skills. […]

  5. Your post is so true. I have learned to program in Java from my studies. Java is my home so to speak. Dont get me wrong, I am not a Java fanatic, I love the flexibility of Ruby, besides all I have ever done in Ruby is some really really basic stuff.

    But the one thing I will always say is, if it was not for Eclipse/Netbeans/, programming in Java would be such a pain, I think Java would not be as popular anymore.

    The crazy thing is, a lot of the ugly things in Java are done by the IDE. If it had the flexibility of other languages (doing something for each entry of a map for example), I think that could boost the programming fun with Java.