Wednesday, October 10, 2007 -
Update: I've responded to many of the comments below here I love Rails - let me just get that out of the way right now. As many who've read my blog know, I think it's the Dog's Bollucks in terms of a developer's framework. But that seems to be a problem with Rails - the focus is on rapid development only. What happens after that is up to you.
Rails is a Developer's Framework. Built by egomaniacal developers, for developers
Did I mention that I love Rails? A lot of people have suggested that if I love Rails so much, I should just become a Rails developer:
Dude if you love Rails so much, why don't you just marry it?
Good idea. The problem is that I'd like to actually STAY MARRIED and not get a divorce as soon as my server CPU pegs and my client fires me because my app won't scale. In addition the project seems to have been hijacked by a foul-mouthed prissy Dane who has a Jesus Complex. Seriously - how far can I go with this kind of inattention to things that are really, really important?
Dude, Killer Set of Unit Tests. Can I See Under the Hood?
A developer's platform is awesome in theory - the problem is that it's "too vertical" - in other words it's too specialized for one purpose. There are reasons why people don't drive around cars that were "built by mechanics, for mechanics" (we'd all end up driving around 1968 Capris) and houses that were "built by plumbers, for plumbers" (but can you imagine the dishwasher)! When I first tried Rails I remember the feeling of freedom and longing for something new. It was almost pubescent. I wanted to throw all things ASP.NET out the window, grab my Mac, and become radical like Morpheus. My wife liked the leather idea, but when I shaved my head she put a stop to the whole thing. This is what the owner of CD Baby (Derek Sivers) said about Rails when he first messed with it just two years ago:
Like a lost soul walkin’ the earth, lookin’ for spirituality, that stumbles upon the right church with the right people at the right time, I’ve found my niche with Ruby. Its little itty-bitty community attracts some brilliant “think different” types with a love for beautiful code that do this for love, not money.
He then committed to rebuilding all of CD Baby using Rails:
Since all existing code is built around some real fundamental flaws, a total rewrite is not just a necessity but very exciting. <snip> Rails expert Jeremy Kemper is doing the most work, up-front, and Tobias Luetke is on board to help too. We'll be contributing all changes back to the Rails code repository.
I gotta tell ya, after reading this I was looking for any reason I could find to jump the fence like Mike Gunderloy and become a Rails programmer. This lasted for 15 minutes until I looked across the room at my family and realized they couldn't live off beer and Cheeze Whiz as easily as me. But I must admit, I was hooked...
DHH - You Got My Back With This Stuff?
The Rails dudes are pretty damn smart. But they're also pretty damn arrogant. As DHH says:
I'm not in this world to create Rails for you. I'm in this world to create Rails for me and if you happen to like that version of Rails that I'm creating for me, than you are going to have a great time.
One of the more shocking presentations I've ever seen involves DHH telling his audience who he's writing Rails for, and why he doesn't really listen to the community when they suggest where he should take it:
Maybe it's a language thing - those Euro guys can swear a lot. Maybe "Fuck You" means something different in Copenhagen? I'm sure that Biz Stone has an idea as to what it means (and I'm sure he's said it a few times, aimed at Denmark) - he's got a business built on top of Mr. Potty Mouth's software...
Channeling Biz
Biz, if you're Google Alert or Technorati ping sent you here - I'd love a comment... For the rest of you, Imagine you're Biz Stone, sitting on top of the Viral Masterpiece that is Twitter. An amazing little application that does so little, but make people pretty damn happy. As we all know, Twitter is having problems - Alex Payne, one of the Twitter Developers, discusses this at length (emphasis mine):
Twitter is the biggest Rails site on the net right now. Running on Rails has forced us to deal with scaling issues - issues that any growing site eventually contends with - far sooner than I think we would on another framework.The common wisdom in the Rails community .. is .. just throw more CPUs at it. The problem is that more instances of Rails ... means more requests to your database. At this point in time there’s no facility in Rails to talk to more than one database at a time. <snip> All the convenience methods and syntactical sugar that makes Rails such a pleasure for coders ends up being absolutely punishing, performance-wise. Once you hit a certain threshold of traffic, either you need to strip out all the costly neat stuff that Rails does for you (RJS, ActiveRecord, ActiveSupport, etc.) or move the slow parts of your application out of Rails, or both.It’s also worth mentioning that there shouldn’t be doubt in anybody’s mind at this point that Ruby itself is slow. ... Ruby is slow
Ouch. Looks like Twitter is Riding Rails right off a cliff. I'll tell ya what, If I'm a savvy Web 2.0-funding VC, one of my first questions is going to be something along the lines of "So when are you guys going to get this app off Rails"? I just left Twitter today. It's annoying. That damn bird and cat screwing off in "ur serverz" is really, really annoying. To tell you the truth, I can't believe Twitter is even talking about funding right now - I'll guess one of the conditions of said funding is a move to a new platform. Hmmm.
How Does Campfire Do It?
I just watched a pretty informative interview with DHH at RailsConf in Canada. The interviewer asked some very pointed questions, and one of them is about Campfire, and how they scaled it. DHH was pretty candid (is he ever not? Emphasis mine):
...we started to do stress testing, we started running performance benchmarks and we realized that the initial setup we had was just not fast enough. Step one was adding caching in Rails. We were generating a lot of JavaScript dynamically, so we started caching that JavaScript, shoving it in into a database and then serving it out. That made a huge jump and we actually launched on that...in our case we (eventually) did feel the need to make something faster, so we looked at the Campfire application. Where was the bottleneck? Where were we having issues or issues that were going too slow? We found that bottleneck and that bottleneck was a hundred lines of Ruby code. <snip> So we chose to rewrite those hundred lines of Ruby code, to see what it would take to write it in the fastest language we can rewrite it in; we didn't rewrite it in assember, but we rewrote it in C, a fantastic language for rewriting performance bottlenecks.
Yah I rewrite a lot of stuff in C when I can't get my app to scale properly... it's so ... cushy. So your choice, when you come down to it, is to "throw more CPUs at it" or "rewrite it in C". There you have it. I wish the answer was something else but I'm guessing that if DHH were here he'd tell me to Fuck Off. In fact I'm sure of that.
What DHH Should Be Saying
The thing that I'm amazed about, as I watch these videos and statements come out of the Rails Core Team, is that they don't really care about YOUR deployment issues. In the same interview, DHH responded to the scaling question with this:
The hardest part of computer science to ever make general statements about, is performance. I think that there's nobody who can really answer your performance questions, except for you, in your particular situation, under your particular constraint, on that exact setup that you're going to use. Tons of people will claim that they can answer your scaling or performance needs and they will try to sell you a software to do that, and I think they are lying
So he's basically telling you that no one can tell you what to do but you. And if you do then you're lying to yourself. So tough shit. What he should have said:
The Core Team is committed to helping build a CGI application that will run on any server, and run in a threaded environment to maximize multi-processor servers so that the cost of running Rails can be minimized. I'm still all about me in this whole Rails thing, but now that people are using our stuff (and their businesses are depending on it), I'm beginning to see that I have some responsibility here. I can't keep telling people to fuck off. We listen to our community.
If you think I'm being a bit hard on the poor guy, you might want to take a look at his blog. He has a charming entry in April entitled "You're not on a fucking plane (and if you are, it doesn't matter)!" (there's that Potty Mouth thing again) in which he decides that offline web apps are "bizzare" and "puzzling". You see I've bought in to the whole Rails thing. So much so that I thought the ASP community would benefit from a port. I still believe that, but I'm hoping someone will send a big Hawaiian Moke after me to "Wop my jaw" if I ever act like a Potty Mouth Dane. I can't even imagine addressing my users this way. I'd really love to see this platform grow away from what makes Mr. Happy feel good.
"Ice Ahead!!" - or Why I'm NOT Picking On Rails
Some people might be thinking that I'm not being fair to a platform that I love. The truth is that I'm kind of pissed off as I watch Mr. Potty Mouth take a ground-breaking platform and "Rick James" it into narcissistic mess on the floor. This could be the thing that pricks The Bubble. Consider that Rails is the Love Child of Web 2.0 and Disillusioned Web 1.0 Developers, whole shops and corporate departments are adopting Rails as a way to push their applications into production more rapidly - what happens when they try to scale these apps and get "Twitter'd"? People get fired and turn sour as years of their lives are wasted by a platform helmed by Prince Potty Mouth. The owner of the Jazz Music site CD Baby (Derek Sivers) had this to say about Ruby just two years ago:
Like a lost soul walkin’ the earth, lookin’ for spirituality, that stumbles upon the right church with the right people at the right time, I’ve found my niche with Ruby. Its little itty-bitty community attracts some brilliant “think different” types with a love for beautiful code that do this for love, not money.
Fast-forward two years (what you and I call today):
Two years later, after various setbacks, we were less than halfway done. The entire music distribution world had changed, and we were still working on the same goddamn rewrite. I said fuckit, and we abandoned the Rails rewrite. I didn’t abandon the rewrite IDEA, though. I just asked myself one important question: “Is there anything Rails can do, that PHP CAN’T do?” The answer is no. I threw away 2 years of Rails code, and opened a new empty Subversion respository. Then in a mere TWO MONTHS, by myself, not even telling anyone I was doing this, using nothing but vi, and no frameworks, I rewrote CD Baby from scratch in PHP. Done! Launched! And it works amazingly well.
This guy was lucky. He's the boss. I reiterate: The Rails Team needs to accept that they are now a VENDOR, not radical mavericks.
Oh Look! Successful Are We?
Which brings me to my closing point: It's easy to be the punk upstart. It's harder to be successful. That's what this is all about isn't it? The Rails guys are really, really successful because they created a Bitchen Platform. Unfortunately it seems like they're not going to be responsible for it. Microsoft gets this part right (most of the time) - they understand (mostly) the weight of doing good stuff, and it comes down to the Uncle Ben Principle:
With great power comes great responsibility
People love to bitch about patents, legalese, lawyers, copyright, etc. but when it comes down to it - when you make something, just like a child, you have to go to great lengths to foster it, protect it, and grow it properly. I won't claim that Microsoft is the Poster Child here, but look at what's coming soon: the MVC Framework, the .NET Source available for debugging, Open Source big noses brought in to work the ASP platform, giving the codecs to the Moonlight project... they are getting it, and they are listening. The last thing you do is to tell it to Fuck Off.
On another note, do you ever sleep? I would be fascinated to know what your daily schedule is like. You post like crazy on your blog, respond to a bazillion issues in the forums, travel around the US to help make sure your friends actually follow through with their wedding, spend time with your wife and daughter and on top of all that have time to check out new platforms like Django. I'm impressed.
On a side note I'm often irked by those that moved from .NET over to Rails and hail it like the slicing of bread, especially when I see a lot of what they're raving about are things that aren't Rails specific or would actually be horrible in real-world situations. There is one blog, Softies on Rails, that runs hot and cold, sometimes they point out really good things while a lot of the times I feel they are excited about Rails simply because it's something new and different and probably what they were doing before was soul-crushing no matter what language it was done in.
In a funny twist I'm actually porting a Rails app, the amazing and wonderful Radiant CMS, over to .NET, pretty much mind-melding it with the SubSonic Starter Kit. I love Radiant but trying to make it performent on a shared host is just a pain in the arse. You have to do all these contortions to make sure fdispatch doesn't go all Koi fish in a pond.
Lastly, it must be said this really shouldn't be a reason for .NET devs to gloat either, there is plenty about .NET that needs work and other things that are just maddening, the truth is there is no perfect language or framework or methodology, hence why it's so fun to learn new ones.
Great post. The cultural divide, as demonstrated in the comments, is fascinating. I'm with you on treating people respectfully and acting like an adult, but I certainly also agree with the thoughts of commenters like Dean: "...DHH's philosophy of a small & opinionated framework is what keeps Rails from becoming J2EE" and Ryan: "he doesn't care about the community - so why would he care if the community up and left? He wouldn't. That's the beauty of DHH's attitude. He's arrogant and condescending, and he's entitled, and if you don't think so then you can leave and he wont complain."
That's the essence of DHH and I think that it's worthy of respect in its own way. Talk about "separation of concerns". However, I also agree with your suggestion that a growing community can engender at least the opportunity if not the obligation to provide leadership, succor, and guidance.
What I don't respect is overstatement like: "The people who don't get it is Microsoft. Sure, they are trying to jump on the Rails bandwagon with an MVC framework of their own, surprise surprise. I guess they figured out Webforms suck and they had better do something about it. One thing the Rails community can rest assured is MS will screw this one up too. I will amazed if they produce the tools that DHH did to help developers create applications fast, it will be in typical MS style to add such a layer of cluster-f'ness to the implementation that it will take twice as long to create a web app using .NET as it does today. Listen carefullly..MS does NOT get it. They have not got it in a long time and there is not reason to believe they will"
Of course this is NOT TRUE. RoR has plenty of issues. I have customers running RoR apps on shared hosting boxes of mine and all I can say is that RoR is not contributing to lowering our global energy footprint - given the way these apps use system resources. Of course, .NET has plenty of issues too. Both platforms have struggles and challenges. The idea that the .NET part of MS "doesn't get it" is very reality impaired as you and most of your readers well know.
They have struggles with moving the big boat and keeping the legacy factors handled, but they also show lots of clue and lots of evidence of specific action in very positive directions. When Rob Bazinet says "Listen carefullly..MS does NOT get it" does he mean that Anders Hjelsberg doesn't get it? Does he mean that Jim Hugunin doesn't get it? Most of all, is he disrespecting ScottGu? Well, I won't abide that. ScottGu is just an amazing guy. He's the one who deserves a cult following, but he's not an egomaniac and he would actively reject such an idea. He's just a guy who "builds a few products for Microsoft".
So, in summary, I propose a continuum of virtuous leadership styles in software development. On one end is DHH, keeping it pure. On the other end is ScottGu, trying to do the right thing. I think some people will be more naturally attracted to one end of this continuum and some will be more attracted to the other. I personally would rather drink a few Red Hook ESBs with ScottGu than a few Carlsbergs with DHH.
Can you please, for the love of God, set the width/height of the images so the page doesn't creep.. slowly.. down as I'm trying to type in this textbox?
Jesus, people. Forget all the high-falutin' language talk for a minute and fix your goddamn HTML 4.01.
As far as Twitter fixing anything, I don't think I share your optimism.
And finally - if I used those words on you, right here, right now, would that be appropriate (note: I never would, just a what-if)? How would you feel about me then? The rest of your comment is FUD.
Also the inexperienced amongst you always seem to mix up performance with scalability. While both are related concerns they are not equivalent. With Mongrel and Mongrel Cluster I do not find Rails to be a scalability issue. I do find how you design the database replication/sharding, etc to be an issue. This is not at all hard to configure in Rails. I have not seen Django bake into their framework a way to automagically configure talking to multiple databases with LESS code/configuration than is needed in Rails. I don't think Django needs to, but why is the emphasis on Rails proving itself and not Django as well? Not to mention PHP frameworks or ASP.NET?
The one thing I agree with DHH with is that Rails as a framework should not be responsible for designing how you architect your database mode of operations. This seemed to be what Twitter was expecting and to be honest has nothing to do with the general application stack as long as you make various configurations possible.
In terms of Django working with Apache and your implication that Rails does not. I suggest you actually do some very basic research before commenting. It could be said that Django doesn't hook in well with Nginx or Lighttpd (both of which are faster than Apache in benchmarks - a simple google search will yield those results and many of them).
I used to write Python/Django applications before Rails, so I am not just a Rubyphile that has never tasted Python or Django itself, unlike others from the other side:) And I would like to say Python is a fine language and Django is a fine framework. I am not dissing it. Django is actually written with a different emphasis in mind (more content driven rather than application oriented). Rails happened to suit our application emphasis more and Ruby as a language works in a fashion more inline with the way my brain does rather than the "one way or the highway" Python philosophy which I respect, but didn't fit with my way of working personally. Why should you care....? Don't I am just showing that I am not as biased as you seem to think I am.
Do I think Rails is perfect - hell no!
Do I think that Ruby is fast - no, but fast enough right now!
Do I think it would be nice if Rails read my mind and added all the multiple database configuration for me - sure, but let us be realistic!
And as for Rails 2.0....I haven't investigated it as it still hasn't be released yet, so we shall see then. How come Django never made 1.0 yet?
Can you please try to address the issues rather than throw the tired "Rails Basher" rhetoric at me? DHH's words are his own. I don't like that he uses those words in front of his audience. Is it "throwing feces" at the guy to tell him I don't like his use of language in front of an audience of professionals? In front of a world-wide audience of peers? I find this defense of someone telling masses of people to F-Off utterly laughable.
In terms of DHH attacking me, I think he's got better things to do. Or maybe not, he posted something about being a Potty Mouth today. It was pretty colorful.
David if you drop by Kauai I'll buy you (and Mike Cantelon) a Mai Tai and apologize for the rough language :P
"Sure, we're arrogant, condescending - but at least I can control the output/mark-up of my sites without viewstate, 1 form, and some hidden inputs and ensure they work in all browsers - because not everyone uses fucking IE."
This rhetoric is so old and tiring. I really wanted to respond to your thoughts but now I toss your comment, like all the other "F-M$" flames into the can. Come on people - you're better then these cliches. Hit me with something to think about will ya?
Reminds me of the similarly potty mouthed Enron traders and financial whizzes, capped with Skilling, on an analysts call, calling a guy an expletive-deleted when he said, "You _appreciate_it?" derivisely, mockingly, in response to Skilling's comments that he appreciated their interest in the numbers.
See, there really should be a better answer here. And seems like he's at a loss for words. Fine if you want to stay at the outer fringes.
I did find it quite funny, also, when, on a Rails blog, they admonished? pleaded? with their users to "stop changing variables they don't own". Huh?
So Welcome to the big leagues. If you can take it.