Bill the Plumber

Plumbing the network

  • Recent Posts

  • c

  • Archives

Go away Ruby

Posted by billburke on August 29, 2007

I’ve been reading the RESTful Web Services book. I like it a lot. The only thing I don’t like is that there is too much Ruby in it. Ruby, please, go away. Might be a good scripting language, I don’t know, but to push Ruby or any typeless language for that matter as the way to do things, is just plainly irresponsible. Hey, I’ve been there. Done projects in Perl, Tcl, and Python. The 1st few weeks of the projects are highly productive. You are loving life. Then you find that you need to refactor. You need to search for usages of an object, oh, guess what, you’re screwed. Its funny to me to see that the people pushing these things are usually book writers, or get-in-get-out consultants.

Using a scripting language is like going to McDonalds. The food is quick and tastes great, but the time you spend on the toilet after just isn’t worth the whole experience. Yes, scripting gives you zero turn around development. But, if the industry is going to move to scripting, let’s rally around something type safe. How about Groovy? Sure, it has its typeless aspects, but it doesn’t stop you from doing pure type safe code. The mass of Java programmers out there can easily switch between it and Java. Or even better, improve Java (and Java EE for that matter) to make it closer to zero turn around. For example, adding the ability for schema changes in java.lang.instrument or even silly things like simplifying the package structure in Java EE.

16 Responses to “Go away Ruby”

  1. At last, someone talks about it loud!It seems these last years scripting development has become sort of Cool – I could never understand why! I strongly agree with your comments regarding type safety and re-use.

    We have to note though that for sure Java could be a bit more flexible in order to bridge the gap of productivity or easy of use in order to take over the MacDonalds effect!

    Anyway I glad someone wrote it..that it’s not so cool as they pretend to be!

  2. Fanf said

    or even better, improve Java (and Java EE for that matter) to make it closer to zero turn around

    Just to point out that it already exists a great alternative to Java : Scala (http://www.scala-lang.org/). It benefits from the state of the art on many computer research domains like compilation, type theroy, functionnal programming, etc. And it runs on top of the JVM.

  3. Sacha said

    Thanks for sharing your MacDonalds experience Bill, I thought that was only me ;)

  4. Claus Menninger said

    We did a 60.000 line of Java project (a pretty low level networking software).
    Just for fun, some ported it to Ruby.
    Result: 15.000 lines of Ruby code and 400 lines of C Code for Performance.
    The Ruby version was much smaller, easier to maintain and thanks to the 400 lines of C also faster.

    dynamic languages are the future.

    Claus

  5. billburke said

    Not against dynamic language, Claus, just against typeless languages. Also, need the tooling too, Java is just so mature here and barring a huge industry shift, Ruby ain’t ever gonna catch up. That’s why I think Groovy should be the way to go.

  6. Andy said

    Ruby isn’t typeless it is dynamically typed as opposed to Java which is statically typed. I suggest Ruby can catch up by piggybacking on the JVM and avoiding the prevalent Java design pattern of:

    ThingLocator loc = ThingLocatorFactory.create(ThingLocatorFactory.CONFIG_CONSTANT);
    ThingFactory factory = loc.locate(ThingFactory.CONFIG_CONSTANT);
    Thing thing = factory.create(Thing.OTHER_CONSTANT, Thing.CONSTANT, null);

    Okay a mild exaggeration.

    Rails however does blow, particularly ActiveRecord which is flat stupid, a massive step backwards. I find it frustrating to hear RightIsWrong arguments revived and used to justify it or stupid 400x faster bla.

    Ruby has its places. Check this out:

    http://buni.org/viewvc/meldware/mail/mailtest/src/java/org/buni/meldware/mail/imap4/imap_fetch_bodystructure.rb?revision=1.2&view=markup

    You’re telling me I should write a fat assed Java class for this? As for scripting = bad && ruby == scripting…well there is no reason that Ruby can’t be jitted and run on the JVM. Adobe JIT’d JavaScript (ECMAScript) and de-suckified it in the process…why not Ruby? I’m not sold that Java style static typing is the only way and we must be restricted to it to save ourselves from ourselves. Sure strong typing, but dynamic typing and a language meta-model is yummy too. While I’m not a big Web Services fan, binding to a dynamicly created Object is a pretty clean thing to do. In fact you secretly believe this too but don’t even realize it. WTF do you think the JBoss “Invocation” object is!!!! Proxy.create and all is really a workaround for Java not being able to create an object dynamically and your hashtable of arguments isn’t really all that JIT’ed either. In fact under the covers Adobe’s ActionScript interpreter maps Objects when dynamically created to a hashtable…(technically the hashtable and the contents are still jit’d but technically JRuby is jitted at that level).. In other words if dynamic typing is bad then JBossAS is bad too because JBossAS basically creates dynamic typing in Java.

  7. billburke said

    Ruby isn’t typeless it is dynamically typed as opposed to Java which is statically typed.

    Semantics Andy. You get what i mean. (I hate it when people do this BTW. Justifying their arguments with more correct vocabulary is just gay)

    Scripting isn’t bad. dynamically typed or typeless scripting is bad. As I said, the closer we can get Java to zero-turnaround the better, but not at the expense of static typing.

    In other words if dynamic typing is bad then JBossAS is bad too because JBossAS basically creates dynamic typing in Java.

    You sound so ridiculous sometimes Andy. I remember why we didn’t want you in dev(Edited: I’m just poking here Andy, sorry for the insult). java.lang.reflect.Proxy exists to provide a statcially typed interface over a generic construct. Exactly the opposite of what you are saying.

  8. Andy said

    No…you just don’t actually know what you’re talking about. You always argue with me and are batting a very poor average every time you do. Then you get personal and when you get personal you immediately try below the belt, make an ass out of yourself then later realize I was absolutely right. However, that’s why you’re bill burke and why EJB3 leaks memory :-)

    -Andy

  9. Andy said

    Blog slapped back with examples :-) : http://linuxintegrators.com/acoliver/code/2007/09/10/x-0336.html

  10. [...] Go away Ruby [...]

  11. [...] RoR is going to kill JBoss…Seriously?!?! If RoR is such a threat, why are other Java app server vendors “doing okay“? Is there something more here? [...]

  12. [...] Go away Ruby [...]

  13. Odi said

    I want to see a project team of 14 developers working on a 5000 classes project with nearly 400 Oracle tables in Ruby. We are doing this in J2EE (with JBoss) and we are very happy. I do semantic code browsing a lot, search for uses, type hierarchies, renaming during refactoring etc. And I tell you, you are not gonna do this in Ruby – never.

  14. JEE development in the sense of turnaround it getting closer and closer to scripting languages. There is a commercial product JavaRebel that instantly reloads changes made to classes. So you can add/remove/change fields, methods,classes etc. and just hit reload in the browser or whatever outlet you are using. More information at http://www.zeroturnaround.com/javarebel/

  15. [...] by billburke on December 13, 2007 No, I’m not changing my mind about Ruby just yet, I’m just building up debate ammo [...]

  16. @Andy: “Ruby isn’t typeless.” Concerning references Ruby is typeless.

    @Claus: “The Ruby version was much smaller, easier to maintain and thanks to the 400 lines of C also faster.”
    I’m really interested in maintenance numbers for large dynamic language projects. Do you have numbers for
    how much they did save compared to Java after 5 years?

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>