Working off the trunk of an open source project may seem scary because of all the uncertainties, but my experiences with Django and Rails tell me that this isn’t a matter of choice.
Well actually it is. If you want your project to be maintainable in the future, you have to keep up with the trunk of your framework. If not, then go ahead and pick a version to fix your project on. There you go, who said there aren’t any choices?
Quick aside: I don’t recall the latest Django trunk having an exciting “Gen-X PR-type” name1, so let’s call it “Django Axe2” (because Django is named after a guitarist, etcetc).
Of course I don’t mean that you update whenever Edge/Axe do. But you should do so frequently – once every week or two. While I haven’t been hit with this problem (because my projects actively keep up with Axe/Edge), I can tell from the changesets in both trunks that updating even 100 revisions can sometimes be very tedious.
This is because both frameworks are highly moving targets, with huge swaths of changes coming between versions. Axe recently had the entire Unicode branch merged, and Rails, well a look at the conversation thread here will give an idea of the magnitude of difference between stable and Edge.
What’s more, Django and Rails aren’t standalone projects – they are an entire ecosystem of common apps and plug-ins. And you can bet the most popular ones are going to move to follow Axe/Edge, so those components of your apps are going to be legacy as well.
Okay you say, but the reverse is true as well – what if you are relying on a plug-in that hasn’t upgraded? Well the responsible thing to do in that case is to get that upgrade done yourself, and contribute back. Chances of this happening are not that high unless you’re using something obscure, since most plug-ins for Django and Rails get a lot of love from users of their frameworks.
The consequences of not keeping up with a moving open source target are a lack of flexibility if you’re lucky, and extreme inefficiency if you aren’t:
1. Bug-fixes
While these projects have many instances of successful deployments, they are not without bugs. If one of these bugs suddenly surfaces in your project, you’re going to have to manually patch your version of the framework’s code. This may be fine the first, second, or third time. But keep going at it and the framework code you’re running on becomes a mess of custom backports.
And as time goes on, it becomes harder and harder to make such selective changes, since bugfix X relies on changeset Y, which depends on changeset Z, and so on. You will find yourself climbing up the dependency ladder each time you’re making a change. Soon you realize that the time you saved by not keeping up to date is far less than the time you’re expending to keep your Goldbergian series of patches intact.
2. New features
Say you have to roll-out a version of your Django site supporting other languages. If your Django code is close enough to the Unicode branch, you’ll have a much less painful time upgrading and fixing any issues that come about. Or your manager/client reads all the hype about OpenID, and you suddenly find yourself needing the OpenID plug-in that relies on Revision X. If you’re a thousand revisions behind, have fun upgrading. Or ignore the plug-in, roll your own, and pat yourself on the back. Neither way is as optimal as keeping up in the first place.
I understand that others may have been burned before by projects which had broken stuff in trunk that went unfixed for a long time. The conventional wisdom is to go with a stable release version.
But despite their disclaimers, Django and Rails generally take very good care of their trunks. I don’t think there is too much to worry about here. Plus you can always rollback a changeset or two if breakage occurs – I’m not saying you need every revision the moment it shows up on svn.
It may be a very tired analogy, but think of the time you spend every week or so updating your project to work on the latest framework code as stashing part of your salary away monthly. It gives you security, flexibility, and reduces your project risk.
1 Django doesn’t have a book with a skateboarder on the cover either.
2 Let’s see if lil ol’ me can start a meme.