ThoughtWorks' assessments about Ruby's productivity, speed and maintainability
martinfowler.com/articles/rubyAtThoughtWorks....Posted Jun 12, 2009, 12:45 AM UTC
Posted Jun 12, 2009, 12:45 AM UTC
I question the methodology. This article starts with a self-selected sample and makes no attempt to negate confirmation bias. Asking Ruby developers about Ruby's efficacy has a risk of bias, to understate matters hugely. No matter how pragmatic these developers are, they've already chosen to make their living using this language, for good reasons or bad.
And you really won't get meaningful results unless you answer the "compared to what?" question. Would an alternative approach have given better results? That matters. Otherwise, for all you know, they're really responding to non-language-specific features of the project like a well-run development methodology or good project management. The fact that maintainability was being discussed is another sign of this problem: most of maintainability is driven by good design and by intelligent standards enforcement on a project, not by the language per se.
By the way I like Ruby (and expecially RoR) and I really don't care all that much if some fanboys get over-aggressive about things they half-understand. But I'll put up with the slightly less ideal language features of Python in order to get access to the far more diverse ecosystem and larger pool of experienced developers for that language.
I'm starting to feel the same way. Though I still reach for Ruby when I'm writing a personal project or just thinking-by-coding. I'm not put off by Python's significant indentation in general, but I find that it requires just enough of my attention to distract me a bit. It requires more attention than electric-ruby-mode just inserting end automatically anyway.
[deleted]
The Mingle team has built many features very quickly and they feel the productivity boost they got from Ruby is worth the higher hardware demands on the final product.
eaks. Fair trade or lazy trade? I've heard both sides to this story.. I guess it depends how high you want to scale huh.
[deleted]
I heard attitude is mainly only in the Rail community, not the Ruby community.
Well, it is Rails in particular that has that reputation. Really, I just find most of it amusing. You just have to be down with the "opinionated software" idea. You either like their opinions or you don't. /shrug
As far as Ruby goes, you may want to give it a try. Really it isn't all that different than Python in terms of capabilities and features, but Ruby definitely emphasizes certain concepts that one might not be accustomed to. For example, passing blocks to methods. It isn't just that you can do it. It is that in Ruby it is done everywhere. A huge portion of core/std methods take code blocks. It seems like such a simple idea, but once you start using them, all kinds of really cool things happen. Suddenly you stop using standard for/while loop contructs and everything starts to look like a block passed to a function. For example:
for i in (0..9) do
...stuff
end
Becomes
10.times do |i|
...stuff
end
Where "times" is just a method that takes a block and yields numbers to it. Seems trivial, but you can do really cool things with this contruct like build SQL queries without string concatenation:
@articles = Article.find_where(:all, :include => :author) do |article, author|
article.title =~ "%Foo Title%"
author.any do
name == 'Ezra'
name == 'Fab'
end
end
This will create a full SQL statement including your joins (authors and articles) and where conditions.
Or generate XML from pure Ruby:
xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
xml.title @user.name
xml.author { xml.name @user.name }
xml.entry do
...atom entry
end
end
Of course you can use all your normal Ruby in these blocks. So your SQL generator can have optional conditions or you can write a loop the generates all your Atom entries.
All sorts of DSLs make perfect sense in Ruby.
I find your ActiveRecord example interesting... I seem to remember at one point hearing that one way is good, and gives you a join, and one way is bad, and makes a zillion queries. Are you familiar with this, and if so, could you point out the difference to me? I wouldn't want to get that wrong someday...
Wrong (1+n queries)
@articles = Article.find_xxxx
@articles.each do |a|
a.author
...
end
Good (1 query with join)
@articles = Article.find_xxxx :include => :author
Ah, thank you. So the important insight is to always use :include? My Google-fu is apparently failing me at the moment, "each" isn't exactly a search term that cuts down on results.
Actually, my example was a single query. I wasn't looping over the results. Lookup the "EZ-Where" plugin.
EDIT: Oh, I see you weren't really replying to my example at all. Nevermind.
Eager loading (:include => ) can cause two queries, but never more than that. BTW, my example wasn't straight AR. It is a plugin. Can't do that with plain vanilla AR.
Ah,thanks. "eager loading" is much easier to look up.
What is with the unfounded accusations? The article takes a decent approach to answering the question of if it is worth using Ruby in a professional production environment. Yes, the "more productive" section seems a little odd, but only compares Ruby to C# and Java - which tend to be more verbose and less succinct.
There was no attitude suggesting that Ruby was the only language that one should use. From the article: "Should we be using Groovy, F#, Python, Smalltalk, and others? I wouldn't be surprised if many of the same trade-offs we see for Ruby are true also for these other languages."
Use what you like; if you are productive, than you are successful. But continually accusing a community when there is no relevance to the topic or discussion at hand is hyperbole and only reflects negatively on yourself.
I know my way in Python, but I think knowing Ruby is a valuable skill to have, despite both languages being very similar.
The "flopping-your-cock-on-the-desk" attitude are for the most part artificial and a storm in a teacup. These incidents are usually blown out of proportion thanks to Proggit's biased reporting, i.e. every little Ruby incident is immediately posted and upmodded by the hive mind, while the good things are downmodded.
Of course that doesn't mean that there are no people with attitude issues. There are, but the same can be said about any community, including Python, Java, or whatever. You will find that there are many sensible people in the Ruby community once you get to know it.
The "flopping-your-cock-on-the-desk" attitude are for the most part artificial and a storm in a teacup. These incidents are usually blown out of proportion thanks to Proggit's biased reporting, i.e. every little Ruby incident is immediately posted and upmodded by the hive mind, while the good things are downmodded.
This is exactly it. In Proggit's eyes "Ruby/Rails ego" or "Ruby/Rails vs. Python/Django" are bright, bright colors, whereas "interesting/innovative library in Ruby" is a dull gray, often irrespective of what values of interesting or innovative happen to be involved.
I love working with ruby, and personally I'd say they're pretty much spot on.
That being said, there are a few egos in the ruby/rails community, but really folks like to blow things out of proportion; it makes for high traffic blog posts. Ruby is a great language, but if you're already enjoying Python or Lisp, don't sweat it.
I wrote a post about this a while ago, but it has more to do with defending Ruby's weaknesses than it does promoting its advantages.
Personally, if you're into Python and Lisp, you're not going to find much in Ruby to get really excited about. As far as I'm concerned, Python and Ruby are basically the same. At the very least, they fill the same sort of niche in the language landscape, and if one of them floats your boat, awesome. Python turns me off for some inexplicable reason, but it's a fine language. I just never want to actually code anything in it. Ruby has the same intangible thing going, but in a positive direction.
This is one language battle that isn't really worth anyone's time or effort, due to how similar the languages really are.
I agree that Ruby and Python are very similar. And like you I also find that Python turns me off for some reason. I think it is because Python has the impression of being crufty.
I'm still not sure exactly what it is, but honestly, it's probably the Cult of Guido. I'm just another Perl hacker, I like my TIMTOWTDI, thank you very much.
Me too. I have tried them all one time or other but keep coming back to Perl.
With Moose and MooseX, Perl is becoming pretty interesting again.
Compared to Python and lisp, Ruby is a bit fuzzy around the edges. It has a bit more lisp in it than Python does, but it also has a bit more Perl in it at the same time. If you aren't turned off by that, Ruby is the closest thing to a mainstream lisp (At least in the scripting/web development world).
As for the community, there may be many loud people around, but there is an over all positive can-do spirit as well. Just ignore the air-heads, and you'll be fine.
Positive comments = upmods, negative comments = downmods.
Or so I think.
I've been in this God Damn Biz for way too long; I'll admit it. For the most part, technology hasn't really mattered that much. Generally speaking, it matters that you have really sharp SOBs who know how to get shit done. C, C++, Java, Ruby, Blow Me, whatever. When you work with folks who just "get it", the rest is gravy. I've been doing RoR for the last 2 years. Before that I was doing Java for way too long, blah blah blah, back to my IBM days in the early 90s where I was writing AIX kernal shit. The people make the technology spin. Bad developers make shitty stuff with any technology. Learn to be a developer first. Flopping-your-cock-on-the-desk attitude comes from developers who think they know it all. Stop being used-car salesmen. Learn how to make the CPU spin. Stop pretending you've found a silver bullet.
To be fair, this assessment was more about the viability of even using Ruby in a production environment, not a validation of Ruby being the One True Language.
That said, I wholeheartedly agree with your assertion.
Sheesh, whose cock is on the desk now?
[deleted]