« Showing SWT TableColumn Text | Main | Google Aquires Jotspot »

October 10, 2006

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d83455a82969e200d834baca0253ef

Listed below are links to weblogs that reference Why Ruby?:

Comments

My big concern with ruby is that a lot of the counter arguments against how "loose" it is versus java is "your unit tests will catch it". Now this is all very well and good, but assuming that any variable can be any type of thing (array versus single item) doesn't seem like something you really *need* if you just design things properly. Also: having to write a hundred extra tests to do things that the java compiler did doesn't seem like a huge time saving feature of a language.

I'm also not a huge fan of obsession over trying to reduce code down to the smallest most funky/tricky number of lines of code. Smacks of PERL (and we know how maintainable that is).

To me maintainability and readability are more important. The times I've dug into ruby code it just seems cluttered, "dense" and quite tricky to read (perhaps cos people are trying to minimise code and use the funky syntax to the full).

I've played around with ruby (like everyone) and haven't used it commercially (like everyone) and I'm sure for small trivial things you can find more succinct syntax. I've witnessed many other products and technologies demoed with dinky little CRUD apps created in 3 clicks but which choke and require lots of tinkering to do anything real world. There are some nice things about ruby syntax that just "make sense", but it needs to tighten up other areas I think.

Given the lack of developer tool support, limited library support and lack of ability to let the compiler catch common things I think it has a long way to go before it's truly useful (and I don't think it is as inherently enterprise applicable as java is). I will say it does have quite a lot of tutorials and documentation out there which is a definite plus.

The way you can just avoid declaring types makes it feel a lot like VB to me, which does the same sort of "cool stuff" allowing you to get away with loosly working out what something should be at any time you like.. And I fear that if used in the same way, will have the same maintainability and dodginess as VB.. Think it was a case of "give a man enough rope he'll hang himself with it", having 20 types of funky syntax to do a for loop in my opinion is not a good idea. Allowing someone the laziness of avoiding typing of variables is like java only allowing variables to be type "Object", sure that might make things easier to do sloppy or confusing things ("is this a string or an array or an object or what?") but really laughs in the face of common sense.

Bit harsh I know comparing it to VB, but VB was a scripting language that promised doing lots with less lines of code (the same arguments all the .net coders tried to use against java). Lines of code as a measure of a programming language's quality doesn't sit well with me, nor does getting excited about funky low level programming syntax.. ;)

Java being "bloated" tends to mean "the functionality you need in the API is there". Having a minimal included base API means you have to dig up 3rd party APIs for everything, and wasn't that a roaring success for the standardisation of c/c++!? Not having to track down and verify the usability of ten thousand external libraries to do stuff that the Java API provides by default is a hell of a timesaver.

I don't really see how ruby is more powerful though, what do you mean by that? To me java has more tools, libraries, included functionality, app server choices, platform choices (OS and application type: EE, SE, mobile etc) and proven reliability. Thus, more "powerful"?
Or is this along the lines of "assembly is more powerful than C which is more powerful than java"? Yes: assembly is more powerful, you can do anythign you like... So long as you have the time, resources, patience to do everything from the ground up and completely again for any change in platform or architecture.

Or maybe I just don't like having "end" all over the place (I like my squiggly brackets.. less characters that "end" so it must be better hehe). ;)

So short answer as for why java over ruby:
* Java is an order of magnitude more proven, deployed and tested in the real world
* Java has far larger, more powerful, more standard base API
* Java is a known quantity with customers, you are less likely to be stuck on an unproven platform
* There are far more java coders available to support your applications in industry
* Java has less hype and more substance


But enough shit stirring ;) I think best tool for the job, scripting languages (regardless of how funky) in my book are suitable for a certain type of application..

Nath

Nath, good to hear from you. This has to be one the lengthiest and best formed comments to any post of mine. Much appreciated.

You state:

"* Java is an order of magnitude more proven, deployed and tested in the real world"

True, as will always be the case for the previous great programming language. I still love Java and in certain scenarios would continue to recommend it. However, Ruby is finding its way into increasingly mission critical applications (working on one now).

"* Java has far larger, more powerful, more standard base API"

Larger, true. More powerful - as you asked yourself: what is "power". To me, it is the ability reuse, write, and deploy new applications quickly. Ruby simply has fewer speed bumps and allows you to do more with less.


"* Java is a known quantity with customers, you are less likely to be stuck on an unproven platform"

True. This is part of the growing pain of any new language and associated catalyst. As Ruby is increasingly deployed, however, this argument inevitably fades away.

"* There are far more java coders available to support your applications in industry"

True, again. However, given the productivity benefits of Ruby, small investments in training can return a company's investment in short order. In the end, Ruby requires fewer resources to do the same work. Addtionally, it seems clear that ramping up with Ruby (and Rails, et al) can be done more quickly that it would take to ramp up to a comparable production app using Spring, Struts, etc. Java could close this gap, however. And, I expect it will.

"* Java has less hype and more substance"

No disagreement about the hype. Java's 'substance' is part of the problem though. It has too much. Ruby, Rails, etc. has made large waves with the philosophy that simplicity and doing more with less (in the right places, of course) can sometimes be a better way. Perhaps, even most of the time.

Though I've been neglecting the internet and blogging community a tad lately.. Your post caught my eye as I'd just been playing around with ruby a bit more that day..

So I guess where you and I disagree on is APIs and what should be "platform" and what should be "external library". Java has a history of criticism from the early days about having a large API, although I tend to regard it as having a very large toolshed full of various things. Sure you can say having that shed full of tools is "bloated" and "unnecessary", but (sticking with the analogy) it does save you having to jump in the car to trek around town when you need a phillips head screwdriver or a spanner..
It also means that if you move house (Operating system? platform etc) it comes with a pre-stocked garage complete with the same tools you're used to at your old house..

I do worry I'm a bit negative about ruby at times just the same way people were towards java when it came along all shiny and new with a JVM, garbage collection, large standard API etc.. But the lack of typing does scare me a bit I must admit. I don't really know what the reason for missing out this feature, I guess the inventor (matz was it?) didn't like having to do it.. I also got a little burnt when trying to debug a ruby app (damage control) and ended up stuck on a bug that the only google results for it were people posting that they'd come across it and it was a low low level ruby error.
But that's probably just the newness of the language and with time that starts to go away..

Something else I came across that was a little worrying was a set of slides on the future major release. It seems once again ruby will be one of those platforms that change things in such a way to require extensive re-coding/testing of existing code because maintainability takes a back seat to "we want to do xyz in the next version". Java's never taken anything out of the API (though there's a JSR in the pipeline that talks about cleaning some things up). .NET did this sort of thing where they pay little attention to making a version increment smooth and it is their clients who wear the significant cost of migration between versions.

Web app productivity: yeah, I agree that any framework should allow things to get done quickly. I had started on a little project to create template applications for things to speed things along, but alas got sidetracked as usual with these things ;). Some of the IDE's are making things quicker, I've had some fairly speedy to modify apps (even struts) due to the appropriate setup of maven/ant scripts with autogeneration of things like hibernate.. But there's still an entry barrier that could be lower..

Nath

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been saved. Comments are moderated and will not appear until approved by the author. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Comments are moderated, and will not appear until the author has approved them.