Sunjay Pandey of AlterThought has an an article that makes a case against Ruby on Rails. I usually try to stay out of these discussions; every technology has advantages and disadvantages, and I am well aware of the good (quality, speed, testing, maintainability, small community) and the bad (Ruby needs a good VM, Rails is young, small community) when it comes to Rails.
So after a pro-Rails post, Sunjay decided to outline the problems with Rails. It isn’t a very good presentation of Rails’ problems, and yet Sunjay’s focus is interesting. He focuses on the Rails community and Rails developers when discussing what is wrong with Rails. Here is the core of his argument:
The unfortunate reality of the RoR movement and market is that there are a number of below average soloists passing themselves off as solid developers due to the level of demand.
and
(1) Rails helps bad coders write unscalable, unmaintainable, unmentionable code faster, ergo (2) Rails helps organizations fail faster.
The first quote is interesting. The second is completely wrong.
What is the developer quality of the Rails world?
(See Dan Grigsby’s recent article on the Rails contract market for prerequisite reading.)
Rails largely draws its market share from PHP and Java. Rails apps can be written as quickly as PHP, and can be as robust and maintainable as Java. And developer satisfaction exceeds both.
In my experience, the Rails community is extremely strong at the top, like the best of the Python, Java, and Lisp communities. People like Dave Thomas set the tone of the Ruby and Rails community, and you couldn’t ask for a better tone-setter. Most professional Ruby developers that I know are smart, personable, and pragmatic – the kinds of folks that you want on your development team.
At the same time, there are a more and more mediocre Rails developers watering down the community. This wasn’t true two years ago, but as Rails grows, it attracts more and more newbies. There is nothing wrong with this; Rails is pretty welcoming to newbies, and today’s newbies are tomorrow’s experts.
If there is a problem with the quality of work coming out of the Rails world, the problem lies with demand. Rails allows applications to be written more quickly, and therefore more cheaply. This means that many businesses who are looking for a cheap option look to Rails. Not content to save money through the efficiency of Rails, they also look for cheaper developers. In essence, they create a demand for $40/hour companies and $10,000 social networks. And you know how markets go; if the demand is there, someone will meet it.
Newbie Rails developers aren’t a bad thing. Newbie Rails developers passing themselves off as experienced Rails developers, because a client wants top quality work for $40/hour, are a problem.
So what does this mean? Don’t hire a $40/hour company unless you want $40/hour work. Don’t hire someone with a thin portfolio unless you’re willing to accept the risk. Don’t hire anyone who claims to be a Ruby rockstar, ninja, pirate, whatever. If you want a well-written app, and if you’re dealing with complex problems, hire a good developer with good experience, and pay them what they’re worth. Like the authors of Railspikes. (Shameless plug – sorry!)
Does Rails encourage bad code?
As I said, the Rails community is mostly a mix of ex-Java developers and ex-PHP/Perl developers. PHP isn’t all bad, but it is unfortunately a magnet for bad code. This could be because many bad coders choose PHP, or because PHP has really low barriers for entry, or because PHP itself encourages bad development practices. I suggest that it is a combination of these. The end result: PHP does not have a culture of high programming standards. Design patterns, unit testing, etc. are on the margins of the PHP world. There are good PHP developers, and you can write good code with PHP, but PHP (and the PHP community) isn’t going to help you out too much.
Sunjay assumes that the latter is true of Rails, but he is wrong. The Rails framework and the Rails community are both built on a culture of good programming habits.
- Unit tests? Built in and highly encouraged. Rails all but screams at you if you don’t test your code.
- Deployment automation? Capistrano takes about 10 minutes to configure and works beautifully.
- Source control? Rails assumes you’ll use source control. There are rake tasks that automatically add new classes to your SCM, and Capistrano pretty much requires it.
- Web services? You get REST for free.
- Design patterns? 80% of Rails is an implementation of MVC and ActiveRecord. ActiveRecord works like a charm for the vast majority of applications, and MVC is a beautiful way to structure web application code.
- Platform? Stay away from Windows. OS X, Linux, BSD, Solaris, work great. (This is “checkmate” when it comes to good programming habits.)
Rails pushes developers in the right direction. Give Rails to a bad coder, check back in two years, and you’ll find a good developer.
So Rails doesn’t “helps bad coders write unscalable, unmaintainable, unmentionable code faster”. It encourages you to write scalable, maintainable, mentionable code. If you do the opposite – no tests, logic in your views, duplication – it’s because you’re misusing Rails.
Profile of a Rails community
I am fortunate to be involved with the Ruby Users of Minnesota. Most of my opinions about the Rails community come from my experience with RUM (along with reading blogs and attending conferences). Based on these experiences, here is my impression of the Rails world.
- Rails is full of really good Java developers who got sick of writing XML. Like: the folks who would be leads on most Java teams; the folks who choose (and enjoy) the hard problems; the folks who know what is right with Java, what is wrong with Java, and what other options exist.
- The average Rails developer has pretty good business sense. Rails lets you code pretty closely to the business problems. If you can write an e-commerce engine in a few weeks, the ratio of time spent thinking about interaction and user experience compared to time spent writing low-level classes is pretty high. So it helps to have good business sense.
- Similarly, Rails usually draws developers with good people skills. (This might be related to the previous point.)
- Most Rails developers are interested in technologies beyond Rails. Functional programming, for example, is pretty hot at our local Ruby group.
- Most Rails developers made a conscious choice to switch to Rails from J2EE/Perl/PHP/whatever. So they usually aren’t technology zealots, and they usually see the other side clearly. At our last two meetings, we had a Python developer present Django, and a Groovy developer present Grails, and both were very well received.
That’s the Minnesota Ruby community in a nutshell. If RUM is a microcosm of the larger Rails world, and I think that it is, then the Rails community is a pretty interesting place to be.