Patrick Lightbody is on the steering committee of the Java web-framework WebWork and not at all happy about all the attention Ruby on Rails is gaining. Apparently, it's all terribly undeserving as Rails surely "doesn't scale" to applications with "thousands of concurrent users and/or hundreds of thousands of gigabytes", right?
Of course, Patrick doesn't bother to back up his charge besides asserting that "anyone... knows that a CRUD framework just doesn't cut it". Interesting. Rails follows a similar approach to scaling as do Yahoo and LiveJournal. Share Nothing. Push concurrency into the database and the memcache. I hear that approach is working rather well on LJ's 100 machine park handling 5+ million dynamic requests per day.
But why bother addressing the specifics when you can just assert the somewhat cryptic "Mapping web UI directly to the DB never scales". What does this mean exactly? Does Patrick think that the only UI you can do in Rails is a scaffolded one? Oy, talk about forming ill-informed opinions.
If any of these vague, hand-waving assertions should have failed to convince you, then of course, we can always rely on our good friend complexity!
Form processing, payroll, etc probably work very well with RoR. But trying to implement Spoke using RoR would be impossible — the schema is just too complex.
I'm sure it's too complex, Patrick. Can't beat an expert at his own game. But since you're interested in learning more about marketing your open source wares, you might start by dropping the FUD tactics. They leave such nasty stains of ignorance and bitterness.
Brian McCallister offers a similar rejection of Patrick's fear mongering:
It is scary (FEAR FEAR) to see opinions formed, and backed with vitriol, by fear that something different than what they are doing works better. Something you don't know that approaches the same problems as something you do know does not make the first thing bad. It does not justify lashing out at it saying "it is just [foo] and sucks so bad compared to [bar] and can never [scale|perform|manage|eat] enough to be used for [serious|difficult|real] things." Possibly this is true, but reacting that way out of fear certainly does not make it so.
Now back to our mega-scala-enterprisy-serious-real-complex-important work. Nothing to see here, move along.
Please, do explain then how RoR is "10X faster than Java". Brian (as well as Matt Raible) and I had a very polite discussion about this. I'm not out to take anything away from RoR, but I do get quite frustrated when people make ridiculous claims like that.
I never hid the fact that all I did was read the the article. My indictment is much more against the Slashdot thread than Ruby on Rails, and I apologize for not making that clear. You can't compare RoR to anything... because there really isn't anything out there like it. It is the flame-bait the bothers me, but I suppose I went ahead and fell in to that trap myself.
I still assert that what I saw in that tutorial would never scale.
I've written a fairly large application in WebWork2 and done a lot of work with Rails. Coming from Struts, WebWork2 was a breath of fresh air. I was amazed at how much more productive I was with it.
Then I met Rails and wrote an application with it. While WebWork2 impressed me by getting out of my way a helluva lot more than Struts did, I had no idea that web development could be such a joy as it is with Rails.
Developing 10x faster than Java? Depends what you're developing, but it's definitely possible. I think it'd be foolish to claim it universally though. As for the scaling argument, I'd say it might be applicable to 5% of projects currently written with WW2, and that's being generous.
In fact, I'd say 90% of webapps written in Java would be better served by Rails. There are also another whole ball park of projects that would have added business value that never get started because of the overhead associated with starting a new Java project. Rails removes that overhead and is able to provide business value where Java apps just can't venture.
I'm on the WW mailing list as well as the Rails mailing list. Patrick's contributions to the open source community are highly commendable, but I think in this post, he let his pride get in the way.
WW2 is an amazing effort, and it's probably the closest you'll ever get to Rails with the limitations of Java, but it's not Rails.
Just to be clear, I'd like to add that I understand that "what I saw in the tutorial" != RoR. Also, please see the comments on my blog, I hope that I've made myself more clear. Again, I apologize for the flame-bating myself. I actually dig the RESTful stuff I saw in the tutorial and I immediately was thinking about how I could do something similar in WebWork. It is definitely interesting.
Anoop, thanks for the kind words. I hope I'm cleaning up my mess I created over on my blog as well, so feel free to chime in there.
I never claimed that WebWork made anything more efficient. I still don't. WebWork doesn't try to do as much as RoR and so comparing the two wouldn't make sense. Comparing Java to RoR also doesn't make sense :)
However, Lucas commented over on my blog a very good point: RoR "assumes" a lot more, as does Ruby. I too abhor XML configuration, but at the same time I also don't want everything to be implicit. For example, I worry the security of frameworks like RoR (and WebWork!) where you can invoke a method by simply issuing a simple GET request.
I'm always hesitant to provide any exact measures of productivity increases, but the 10x number has been echoed by more than a few of the Java programmers I've known coming over. Of course, most projects involve lots more than just programming, so this would hardly mean a project completed 10x — or whatever multiplier you fancy — but the difference is indeed startling.
So what I'm committing to is "the difference is indeed startling". Curt Hibbs feels that he has gained a 10x productivity increase over his earlier work with Java. Who am I to argue with that?
I will say, that I easily think that Rails is capable of solving similar problems in drastically less lines of code (in many cases, I don't think 10x would be off.. That is 1 line of Ruby on Rails code standing in for 10 lines of J2EE code).
So if you believe the one about a programmer being able to write the same number of code lines every day regardless of the language, you could arrive at a 10x productivity conclusion. I'll refrain from venturing further into such speculation ;)
I'm glad you can see that the trap of flames and bait caught yourself too. It does sound hollow to lambast the Slashdot crowd -- or anyone -- for outrageous claims and baseless accusations after that tirade.
David,
Good points. Lucas said something very similar about lines of code. My response is that it's all about the tools. Lines of code does not measure effort now that we have better tools available. However, it shouldn't necessarily be dismissed either.
What is unfortunate is that most developers don't actually utilize the tools they have. Even the most hardcore IDEA developers (such as myself) are still learning new commands every day.
I've done a huge amount of work in Tapestry and have been writing a small app for myself in RoR. I love them both--but my experience in RoR doesn't compare with my experience in Tapestry. The rapid time to a running app with RoR is amazing. The scaffolding and other code generation to get the app going is really smart. Will I abandon Tapestry for RoR? I have no idea! I find Tapestry to be the most brilliant Web framework in the Java realm (I haven't used Web Work II, but hear good things about it), but I find myself very drawn to RoR. So far I've found that what I learn in one has complemented my devlepment in the other.
My attitude is that if it works, it's fun, it's productive, and others are building successful applications and are excited by the framework, then it's worth checking out. So far I see Rails eventually becoming my other main Web framework and which I use will depend on the job's requirements.
One wonderful aspect of Ruby is its expressiveness. Another is its terseness. Java doesn't come close in either regard (a reason there is such momentum behind Groovy). But, being a strongly-typed language, we get all the wonderful help from tools like IDEA and Eclipse. I miss that help when I write in Ruby and I miss Ruby's expressiveness when I write in Java.
One thing that is so compelling about Rails is that you can have a fully functional database-backed Web application running in very few lines of code. Sure, it might be completely simplistic, but what's cool is that it gets you running out of the gate with working code--one of the hallmarks of Agile development: get simple code working and iterate!
Just to re-iterate a comment I left on Patrick's blog. Lines of code do matter. If two programs do the exact same thing and one is written in less than half of the lines of code, it is a good guess that the smaller one is the better of the two. If a language consistently lets you write less code to do the same thing, that gives it an edge.
This is for a number of reasons, for example it cuts development time. It is also a lot easier to debug. Find the error in the following Hello World,
class HelloWorldApp {
public stalic void main(String[] args) {
System.out.println("Hello World!")
}
}
Versus in the Ruby world:
prlnt "Hello World!"
This is a microcosm for bigger problems. When the program gets to be thousands of lines long, why should you have to drudge through more than twice the code to understand the same procedure? On a purely aesthetic level, Ruby is pretty which makes development more enjoyable. I personally work much faster in an enjoyable environment than otherwise.
By the way, if you didn't catch it, there were two errors in the Java version.
Lucas,
Again, you are missing the entire point. Comparing _lines_ of code is meaningless. Comparing _effort_ of creation, debugging, and maintainence is the only valid way to compare two different ways to build something.
As I said in my blog, I can get pretty damn close to your 'print "Hello World!"' example by using IntelliJ IDEA and typing:
-HelloWorldpsvmsoutHello World!
That's it. I count 33 keystrokes. In Ruby it would be:
cat > main.rbprlnt "Hello World!"-D
I count 37 (or 22 if you think creating the file isn't fair, though I did the same in IDEA).
The point is that the effort is similar. And that is because the tools available to the developer are designed to make the person effecient. In the case of Ruby, the language is the tool and there is a lot to of good things to say about that. In the case of Java, IDEA is the tool. But the _effort_ is the same.
Then one could get in to the argument about maintainance, debugging, etc. The debate could go on forever. What it comes down to is how effecient are you and what your software development process is. Simply applying LAMP or J2EE or RoE does not make a project successful. In fact, it probably has about as much to do with it as the type of mouse your developers are using.
I was skeptical at first when I heard the 10x productivity increase, but after seeing 2 errors made in the simplest Java program I am a believer... :) My point is that an experienced Ruby developer is not 10x, but 100x more productive than an inexperienced Java developer... But when you compare developers with similar competency in their language of choice and the tools that come with it, the 10x probably comes way down.
As many readers pointed out, productivity is not measured by only the lines of code metric. The single most important variable in the productivity equation is the competency of the developer.
Heck, the javascript file that manages the lists in tadalists has over 200 lines. I am not sure if David has included that in those 600 lines mentioned. Most of the work in these type of applications goes to the design, layout, css, xhtml code.
I think Rails is great, and I am actively following it's development. Having a full stack available for you is quite convenient, especially when you compare it to the Java world where there are a myriad of open source frameworks dealing with a single aspect (mvc, persistence, containers, etc). But there is value also in diversity, as you can pick and choose a la carte what fits best for the project. I am quite confident that using quality frameworks like Hibernate, Spring, Webwork a competent Java developer can be just as productive as a RoR developer, even considering the mythical LoC metric. A disadvantage mentioned quite often is the proliferation of the XML configuration files, but in practice I rarely find myself spending too much time working with those. Although, for a developer inexperienced with the mentioned frameworks there are some steps to climb in the beginning.
Externalizing configuration doesn't make much sense in a scripting language like Ruby, since you deploy it in source form, so you can modify it anytime, in contrast with Java, where you deploy the bytecode and you need to recompile if you change something. Nevertheless, the "sensible defaults" approach could be applied also to Java frameworks to reduce the need for external configuration when the defaults are satisfactory.
Let's cooperate instead of throwing flames around! For example, I use the RDT plugin for Eclipse (written in Java) to develop RoR projects :)
I absolutely agree on this one: Ruby + rails is easily ten times faster than typical Java development. And I (used to) really love Java. You can see that by reading my article from1996 in Linux Jornal called "What is Java, Really?" So I'm a Java zealot, but after a couple years of Ruby (and a few months of Rails) I am a convert. Java just doesn't have the expressiveness Ruby does, and once you get used to rails it really saves you time by essentially eliminating an entire layer of useless code that most other systems require you to write. And just being in Ruby means you never have to write mind-numbing code once you gain enough vocabulary, the language is that rich. This is impossible to guess before you've tried some of the unique syntax features of Ruby, namely iterators, anonymous codeblocks, uniform access, etc.
Let's take for example, a typical change that would be to add a new attribute in a model class. In static typed environments like Java and .NET (I have a strong .NET background), this would be painful and would several steps:
1. Add the column to the database backend
2. Add the column mapping to the object-relational mapping layer code or Modify the save and load methods to acknowledge the new column (and other relevant methods)
3. Add the attribute in the model class
4. Modify the view code (and probably the controller too) to present the new column
5. Recompile everything
6. Redeploy
As in Rails world, it would mostly be:
1. Add the column to the db
2. Modify the view code
So?
Challenge by David Garamond on January 22, 21:04
Patrick said, "My response is that it's all about the tools."
True. Note that language is one of the tools itself. Difference between languages can be one determining factor in productivity.
I've personally found that when I use languages like Pascal (Delphi) and C, I really depend a lot on IDE, debugger, etc. But when using scripting languages like Perl and Ruby, I can cope more just by using text editor and printf statements (or logging framework) for debugging. And I really enjoy the latter more.
I think Rails is overhyped. Like any new technology that people discover, it gets touted as the miracle cure for any problems you face. Which gets people interested, but isn't good for a clear, cool discussion.
I also agree that too much bashing of the Java community is going on - show your maturity and rise above the insults game. Let them see that it's capable and better from the results, not because you can always have another dig at them
Challenge by LoL on January 27, 2:51
I think we should all start programming in ForthOn8086, or as I like to call it "Fo8".
splendid idea!
Challenge by Doug on January 27, 6:28
As someone who likes neither java nor ruby, and none of the java frameworks or rails, it does really seem like David needs to get a grip on his emotions, and quit flaming java and the java community just because they don't think rails is the greatest thing ever. If you are going to spend so much time and effort telling the world how awesome your project is, you need to have the maturity to deal with the inevitable people who disagree. If you can't handle it, then please stop spreading FUD about java, "fear driven" blah blah, and all the rest.