Ruby/Rails -> Python/Django
Posted by Ian J Cottee Sun, 06 Jan 2008 08:32:00 GMT
I’ve not posted much recently about languages and web frameworks. It’s been over 18 months since I blogged at being at the Rails conference and three years since I first started using Rails internally.
The last year has been pretty hard workwise, especially the last six months. A lot of the time I’ve been flat out working on production systems that tie into Toyota’s production lines in Derby. When Toyota update their production processes (which happens quite regularly) we often need to make changes in our systems which feed their requirements to their suppliers. The changes this time around have been quite major. This is all JIT (Just In Time) work and that means our systems can’t have downtimes whilst we try and get new code working. We switch over and if the new code isn’t working 100% within 20 minutes of switch over we’re in queer street. So what happens is a lot of discussion, a lot of coding, a lot of testing and then golive (unfortunately usually during night shifts) when we nail our colours to the mast and let the new code out into the big bad world. When the day dawns we’ve always been exhausted but victorious. But psychologically I find it rather demanding.
Our suppliers supply parts to the Toyota production lines. If they stop producing parts and the parts don’t hit the Toyota production line (in the right order and at the right points) the line will stop. I’m told that stopping the Toyota production lines costs around 300K per hour. I don’t know what sort of shit flies around when that happens as I’ve never done it but it’s a recurring nightmare of mine and certainly in November and December most of my dreams involved production systems.
The backend of our production systems are all written in Python and the place where I spend most of my time. The frontends are written mostly in Ruby on Rails. I’ve not been doing much frontend work over the last year or so although staff changes have forced me to become more involved over the last couple of months. I don’t like frontend work as there’s nothing solid. It doesn’t matter if it does the job, different people will want to have different stuff on the frontend depending on how they’re feeling. The backend stuff is simple logic that doesn’t change. We get signals in from Toyota, we validate them, process them, assign them to different parts of the factory, print stuff out, scan stuff in, set of alarms, fire off information to external systems. There is no interpretation. Just fact.
Anyway, I normally live in Python and normally live working with code that I know basically quite well. I have my own framework based on Python Twisted which does everything we need and is tried and tested in battle over a long period of time. Having worked on various Ruby on Rails projects I have come to love some aspects of Ruby and could happily code in it all day. But I don’t and my fingers can type python a lot quicker than Ruby. There’s no Ruby Twisted framework and although we never have to worry too much about web site performance (they’re usually internal sites used by factory personnel and management) the backend processing does need speed and python wins this hands down.
So as a language I do love Ruby. If I used it day in and day out I think I’d be happy using it as a python replacement but I don’t. And because it doesn’t have the same maturity of libraries and the performance is lacking I can’t. As for Ruby on Rails, I’ve been slowly falling out of love with it, for about the last year I think. I think mostly because I spend a lot of my time doing trivial things in web interfaces and I just want to do those trivial things as quickly as possible. Trivial things includes, for example, stuff like maintenance screens, standard security, auditing etc. Rails doesn’t do that as part of it’s core so we have a myriad of different addons which may be supported in the next year, or until next week.
This is not the fault of Rails – the core team can focus it wherever they want. And if I had the time I could no doubt write my own addons but frankly, why bother when I can just use Django which is written in Python and gives me a lot more of what I want for free. And so that’s where we are heading and we’ll see where it takes us. This decision is made easier by the fact that earlier this year I passed over all responsibility for developement to Andy and he hates Rails with a holy hatred and loves Django.
We’ll see how we go. If I can actually spend some time learning it properly and not just flail around when I have a requirement that would be useful.
Ruby is not out of my life though. We still have Puppet as part of the new Linux builds we’re doing and I’ve not ruled out Capistrano yet.
This announcement is a bit delayed (I was playing with Django this time last year when I was in Japan). But it’s come to the fore because of some interesting posts such as this and this.
Hopefully this time next year I’ll be demonstrating our new common lisp framework ;)

Very interesting indeed Ian (downtime at 300K an hour? bet that focuses minds!).
It’s funny, after wondering the other day why RoR talk (i.e. hype) had gone so quiet in the general blogosphere over the course of 2007, I went looking for information, and quickly found the two posts you’ve linked to. I wasn’t quite sure what to make of the Zed Shaw post. Someone so clearly lacking in interpersonal skills is always going to end up having issues with many of the people he meets and works with. But even after stripping out the ‘angry man’ stuff, the remaining picture of the Rails world wasn’t a particularly attractive one. But then of course, a single person’s view does not a definitive picture paint, what’s more, many of the experiences he’s had are not exactly unique to the Rails community.
I’ve been doing some back-burner pondering over what to learn after PHP . Obviously, for web scripting Python and Ruby are the the two stand out candidates from the FOSS world. I’ve reading around the issue for many months, I’ve pretty much decided that Python will be my next language. I’m impressed with Django’s features, philosophy and the recent feverish activity within its expanding community, I feel more comfortable with Python’s position as the language of choice for FOSS application scripting (although this status is not guaranteed of course), and I don’t hear the same grumblings about Python’s performance that I’m hearing with increasing regularity about Ruby these days.
In a sense, I’m almost pleased that Ruby is suffering growing pains. If it wasn’t, I don’t think I would have been able to choose between it and Python, and would have ended up flipping a coin, something that would obviously preclude any conviction that the decision was made for the right reasons. Still, I’m getting ahead of myself, I doubt that I’ll be making a start on Python for at least six months – and maybe in the meantime someone will wave a magic wand over Ruby’s performance issues?
Whatever, will be very interested indeed to hear about your experiences with Django. Do hope you’ll be able to eke out some time to blog about it.
Oh, and a belated happy new year!
I remember asking Aidan “why not Django?” a couple of years back when I first heard that you guys were going to be doing more RoR and less Zope (which I can certainly sympathise with ;-)
At the time I think it had something to do with SQL Object, or maybe my memory’s buggy. Do you recall?
Anyway, interesting. And 300K, ouch.
We did some work on a database backed ‘framework’, using Plone as the frontend and SQL Object talking to the database. Was interesting but we had some serious problems with SQL Object.
After that I looked at (from memory), RoR, Django, TurboGears (I think), Subway (now defunct I think) and CherryPy. That was … erk … three years ago now I think, certainly before I left Japan and things looked very different then. We first used RoR for a live client system in the Autumn of 2005. According to Wikipedia Django wasn’t even released on an Open Source license until the summer of 2005 in which case I think my mind was probably already set.
Probably, being honest, the bad experiences of SQL Object had left a bad taste in my mouth and I was hankering after something ‘new’ and ‘better’ across the board. RoR was and is still 100 times better than Zope with raw sql backends. But the only way you see how these things really work is to try them in real place. Always a dicey business.