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.
August 30, 2007 at 7:28 am
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!
August 30, 2007 at 7:31 am
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.
August 30, 2007 at 6:48 pm
Thanks for sharing your MacDonalds experience Bill, I thought that was only me
September 6, 2007 at 2:07 pm
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
September 6, 2007 at 4:04 pm
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.
September 7, 2007 at 2:08 am
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.
September 7, 2007 at 12:16 pm
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.
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.
September 9, 2007 at 4:35 am
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
September 11, 2007 at 12:25 am
Blog slapped back with examples
: http://linuxintegrators.com/acoliver/code/2007/09/10/x-0336.html
September 12, 2007 at 1:24 am
[...] Go away Ruby [...]
September 26, 2007 at 5:22 am
[...] 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? [...]
September 26, 2007 at 9:49 am
[...] Go away Ruby [...]
October 1, 2007 at 4:34 pm
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.
October 16, 2007 at 11:29 am
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/
December 13, 2007 at 5:02 pm
[...] by billburke on December 13, 2007 No, I’m not changing my mind about Ruby just yet, I’m just building up debate ammo [...]
January 9, 2008 at 5:42 pm
@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?