Jonathan Worthington :: jnthn.net

Imperative vs declarative train ticket shopping

There's things in England I miss. Like, my friends here, and ale, and the chippie. Today it was time to get some train tickets for a little trip down the country to visit some friends and family, and I remembered how much I didn't miss the railway ticketing system here. No, not the nice "buy online, collect quickly at a station" bit. That bit is quite good. But the price scheme is silly.

To take one example, I looked up the price of a single ticket from Market Harborough to Scarborough, one leg of the journey that I need to do (actually the last one). Price: £56.40. Ouch. But of course, we can play with this. For example, break the journey at Sheffield. It costs £16.00 for an advance ticket to do that first chunk of the journey, and a ticket through to Scarborough from Sheffield sets me back £27.50. Wow. Buy two tickets that get me the same journey and I saved £12.90. Huh?

But wait. I apply the trick again to the second leg. Now I can get an advance from Sheffield to York for £9, and getting from York to Scarborough costs £8.50. That saves me another £10.00 on the second leg.

So in total, by buying three separate tickets to cover the same journey - and thus costing 3 times the amount of ink and paper for the ticket machine to print them all out - I save myself £22.90. I'd say "way to make a profit", but of course it is. Who would think of trying such crazy tricks? Well, not so many folks, I guess. So essentially the fare structure operates on people buying tickets needing to work out where train operating company boundaries might be, or where subsidised lines might be, and break their journey up into steps.

Of course, now I have a nice analogy for imperative vs declarative programming, and how the declarative "just say what you want" model can carry extra cost. If I can make people anywhere else in the world believe that it really does work this way, anyway. :-/

Post Comment

Comment By name

comment5,

All content Copyright (C) Jonathan Worthington 2003-2006 unless otherwise stated.