James Governor's Monkchips

On douchebags, DB2 and Rails: DHH not pragmatic enough?

Share via Twitter Share via Facebook Share via Linkedin Share via Reddit

I was reading this post from Jeff Atwood when something started bothering me. Jeff talks to David Heinemeier Hansson‘s claim that real programmers (that is, ones he would hire) don’t use Windows. Frankly its not just coders that are all now running Macs – I looked around the press room at VMWorld yesterday and Macs outnumbered Winders laptops by 5:2.

I like Hansson and I like his clarity. He is an opinionated guy that writes opinionated software. He was certainly extremely helpful when I asked him a question about maintaining Rails code, and he answered in depth. The whole point about Ruby on Rails, as far as I understand it, is that it favours convention over configuration. I once explained it like so:

Rails is about freedom in the Kantian sense-development has a categorical imperative – what you do should be morally applicable to anyone else in the same circumstance. Its about responsibilities rather than rights. The responsibility to ease of use.

Abstractions are aspects or constraints of the framework itself, rather than veneers to hide code behind and allow ever more configurations to be applied. Freedom comes from accepting and working within constraints. Beautiful code comes from limitations, not being able to configure everything in sight.

Of course Hansson favours the Mac. Its an opinionated system, which fosters user experience best practice. On the Mac choices are limited, and so freedom grows. Every time on a Windows machine you do the same thing differently than you have before you are being less productive, less in flow, less constrained, less creative because you’re not focusing on the job in hand. Oh yeah- and the Mac UI is pretty… which matters. Successful pretty is not an afterthought, its from the root.

Hansson’s view of freedom is seemingly based on a somewhat European, Design-led, view of the world. [on reflection that may just be my philosophical roots showing – Asian thinking also tends to be fairly comfortable with constraints.] Markets, for example, are not absences of rules. On the contrary a market is impossible without clear rules of engagement. A market is a set of constraints. Constraints are thus not a bad thing- they foster creativity. Even the hideousness that is digital rights management can foster creativity

Which finally brings me to the title of this post. Atwood, with a rhetorical, almost Hanssonian, flourish argues:

“when you’re using Rails and OS X, you’re using the platform of choice for douchebags.”

Hansson created Rails but that doesn’t mean everyone that programs in it thinks the same way. Its true the Rails community is a fairly macho culture. Its true some Rails programmers are overly opinionated, but that’s true of any community.

What’s bothering me though is that perhaps Hansson isn’t opinionated enough. You see Rails targets MySQL. MySQL is the Rails database. Forget all the configuration crap and just use MySQL. There is no need to consider other database platforms. LAMP may or may not be a literal but MySQL is utterly embedded in the Rails way. In Rails database is not a design decision, its a given.

So what about the little voice, hectoring me? You see, Matt Biddulph, Dopplr‘s CTO, recommended I read Agile Web Development With Rails: A Pragmatic Guide by Hansson and Dave Thomas. So I did. I am not a developer, but I hope I at least gained a feel for how the Rails framework holds things together. Certainly I gained a better understanding of opinionated software which makes key design, class and documentation decisions for you.

Its worth considering some definitions of pragmatic at this point.

The American Heritage Dictionary: “Dogmatic; dictatorial.”

Princeton University has a particularly interesting definition of pragmatic as a noun:

“an imperial decree that becomes part of the fundamental law of the land.”

So finally my question. Why in the Getting Started section of the book, do the authors even mention DB2 as a potential target database, even if its just an aside (Rails does allow exceptions it just doesn’t like them)? I mean if a DB2 bigot came to ask Hansson for a job at 37Signals he would be shit out luck wouldn’t he? You can imagine the laughs- “this guy wants to back end Rails apps with DB2 – what a ***tard.”

I know Anthony would disagree with me, and arguably Rails abstracts the database decision, so Rails is not tightly coupled to MySQL. But that’s not the point – we’re not talking about JDBC here.

Or was the decision to include other databases in the intro a pragmatic decision in the other, more commonly used, sense of “reality-based”? It never hurts to have IBM on your side after all – Big Blue is now teaching Rails to college students (and I am pretty sure not recommending DB2…)

Anthony says “an increasing number of Rails developers adopting DB2 as their database of choice”.

I would like to know more about this “increasing number” from Anthony, and I also would like to know what David thinks about database choices and related hiring decisions. Why not just say “use MySQL or Get Lost”?

disclosure: IBM is a client. Microsoft is a client. MySQL is a client. I use Windows. My wife has a Mac. RedMonk uses 37Signals Highrise application for case management. I share an office with Dopplr.


  1. Two things:

    One, Rails now targets sqlite by default. (I know your MySQL but was tongue in cheek, but still.)

    And two, doesn’t starting a flame war with someone over a post from their blog that’s a couple of years old make Atwood a douchebag as well? That’s sort of like getting insulted at a party and calling the person back a week later with a brilliant riposte that occurs to you in the shower. Timeliness counts.

  2. Interesting riff about constraints and creativity. I’ve often thought about the blues in this way – a whole genre of great music derived from a simple chord sequence.

  3. actually Rafe that’s pure ignorance on my part. i admit that I thought MySQL was the default target. All the Rails developers I know use MySQL. That does rather answer my abstraction question…

    If nothing else this post clarifies that. Once i get slammed a few times I will correct the body of the post.

    perhaps tongue in cheek in the sense of a reductio ad absurdam – but no, i admit to ignorance.

    douchebag is an overused term.

  4. I think Rails current opinionation over databases comes in dividing databases into two classes, not in anointing one special database. Although sqlite is the default database for Rails 2.0, the distribution also includes first-class support for MySQL and PostgreSQL; switching from one to another of those in a Rails application that follows “the Rails way” is pretty trivial.

    Beyond that, there are ActiveRecord adapters for DB2, SQL Server, and Oracle that are maintained as part of the main ActiveRecord source tree, which puts them into the category of officially supported databases that aren’t in every Rails project by default. It seems to me that the line has been drawn so that if you want “enterprise” database support you have to go hunt for it – on the grounds that (a) most Rails applications won’t need this and (b) Rails has its sweet spot somewhat below the application size where those databases are most usually found.

    Beyond that, of course, since the ActiveRecord code is open source, various people have extended it with additional database support or additional functionality. The ActiveWarehouse project, for example, adds support for data warehousing across several different databases.

    Finally, you might want to take a look at http://db2onrails.com/ .

  5. Thanks Mike – that makes a great deal of sense. Re DB2onRails – look at it? look at it? I *linked to it*. 🙂

    Your point about extensibility is right on. Take shared hosting for example. As I understand it DHH is happy to see someone tackle the problem- but the core group doesn’t see that as an immediate requirement…

  6. My issues with Rails don’t have to do with configuration but rather with getting an application deployed and running painlessly over time.

    Rails apps are easy to write and maintain, but they can be a big pain when you get them out on the server. It seems like my Rails apps are always gobbling up too much memory, or causing the load average on the server to spike, and so on. And it seems like there’s very little guidance out there for people who want to keep that from happening.

  7. […] at Red Monk, James Governor’s response to Atwood’s rant deepened my thoughts by pointing out how design choices reflect […]

  8. And here I thought I was writing a cogent comment. Next time, more coffee first. Sorry for the redundant redundancy.

    Rafe, have you looked at Pragmatic’s “Deploying Rails Applications” book (just emerging from beta, I think)? It does a pretty good job of pulling together a lot of deployment & monitoring knowledge that has been too widespread to find easily.

  9. […] Governor wrote an interesting post entitled “On douchebags, DB2 and Rails: DHH not pragmatic enough?”. It’s […]

Leave a Reply

Your email address will not be published. Required fields are marked *