Audax 2014 – April – Raptobike Attack

The Raptobike has finally been blooded on an Audax distance. I didn’t want to go insane, so a “mere” 100km route.

The speed wasn’t bad, though a touch off what I’ve managed on the race bike. The moving speed is probably the most realistic reflection of the pace because I had a couple of stops that weren’t necessary last time. First was to adjust clothing after a cold start, the second was to take pictures. While the average was similar to previous rides, I did have the satisfaction of burning up about 5 roadies on flat and rolling sections. They would initially try to chase, but would inevitably dwindle to nothing in my mirror. I only caught one up hill, but no one ever caught me, so it can’t have been bad. There were a few hills reaching 15% gradient, which I managed to handle ok.

Putenham Rapto Rapto Putenham 2

My lack of recumbent legs is showing, in that I’ve been crippled for the remainder of the day. Also while the bent was fine for the majority of the ride, there were two weaknesses. A couple of road crossings, I only felt safe getting off and walking across. This was partly because I couldn’t stick my head out the front, like a normal bike to look round the corner and partly because uphill starts are still tricky if not impossible on a slippy surface due to the front wheel drive.

Even in a low gear on greasy tarmac, my initial plant on the pedal caused wheel slip, which meant I lost my speed and had to put my foot down. The front wheel drive didn’t seem to be a problem when actually in motion as as mentioned earlier handled 15% hills. I think it might be a problem if things got much steeper, but then I think my legs couldn’t take anything above 20%.

All in all though a fun ride, hopefully my knees will work again tomorrow!

 

Object Oriented musings

I’ve been in software development for a long time and most of that time has been spent using object oriented languages, including C++, Java and C#. I’ve made plenty of mistakes along the way and I think I have a good guide how to and how not to use some aspects of OO.

A classic OO introductory example I’ve seen is as follows:

class Car{
    const double ACCEL = 1.5;
    double Speed;
 
    void Accelerate(){
        Speed += ACCEL;
    }
}

All makes sense, then I want to add some “real world” logic involving things external to the car. Like, what if the car is going up hill, is running into something or on a slippy surface? I would inevitably end up passing global state to the “Accelerate” method:

class Car{
    const double ACCEL = 1.5;
    double Speed;
 
    void Accelerate(World world){
        // Funky logic involving the World
    }
}

At this point, things are getting confusing because logic is spread between the World and the Car. This gets even worse if inheritance is involved. Imagine a “Vehicle” base class that “Car” inherits from, then a “Motorbike” class that has slightly different acceleration logic involving wheelies etc. This could be sold as “extensible” because I can drop in some other kind of  vehicle without tinkering with the World class. However, this is a maintainability disaster with logic spread out everywhere and logical problems with ordering of calls (think 2 cars accelerating into the path of each other). This example may seem abit contrived, but I’ve seen numerous examples of a “Save” or “Draw” method on a class that embodies the thing to be saved or drawn. In these situations it’s actually worse. What happens if I want to use a different database or rendering engine?

I’ve found that the only way to avoid madness is to ensure that logic is grouped together aggressively. So in our simple example, you’d end up with something like this:

class World{
    List<Vehicle> Vehicles;
 
    void RunWorld(double tick){
        foreach(var vehicle in Vehicles){
            // Common logic incl crash detection
            if(vehicle is a Motorbike){
                // Wheelie logic
            }
        }
    }
}

Now, you might think that this is just moving the logic around. However, I’ve noticed that all the classes like “World” (or “Database” or “RenderingEngine”) are essentially either static, singletons or contexts that are used against static / singleton type classes. These are ideal candidates for an interface and some sort of IoC framework to load in the implementation at runtime.

Heuristics

As a form of guidance, I’ve come up with a set of heuristics to follow when defining a class model. . but it’s a decent starting point.

  1. Identify if a class is one that is static, singleton or a context / wrapper (e.g: Database, Graphics System or World) / wrapper or whether it’s one that carries data (Record, Car or Game Character).
  2. If it’s the former (maybe call these “modules”, borrowed from Javascript?), this is a good place to centralise “business” logic. There is usually little scope for inheritance in these type of classes and they end up implementing a collection of interfaces.
  3. If it’s the latter,
    • Limit methods to only those that affect the data within the object. So Sort(), Validate(), AddX() should all be ok.
    • Drive behaviour from data (via the  “modules”), not methods on the objects.
    • Subclass for common data (maybe all records have a timestamp?) not to add logic in methods.

There will of course be exceptions. For example, I’ve been part of developing an expert system and validation classes. In these cases the logic was intentionally tied to the data carrying objects to that they could be built into a tree (using the composite pattern) and chained (Jquery style) respectively. These cases worked really well, and at least armed with the heuristics described, we could consciously weigh up a different approach.

 

 

First Audax of 2014

I was originally going to kick off 2014 with a 200km ride to celebrate not having a cold any longer, but I decided to truncate it to a 150km to better fit around family.

The route was pretty much a straight shot from Aldershot to Bristol, exploring a few more of the roads north of the M4.

This was the first proper test of the Lynskey Sportive Disc (LSD), here posing while I ate lunch.

Sportive Disc

I still don’t like the height of the rear rack (who needs 6″ clearance from the wheel), but it was the only light one I could find that would also mount a light, which is essential because my rack top bag prevents me from using a seatpost mounted one.

I was a little disappointed by the total and moving average (not as good as my 300km last year!), given I had a mild tailwind all the way. The total average wasn’t helped by getting a puncture at 1/3 distance when I didn’t really gain anything by stopping, then having to stop about 4-5 times to put on and take off my rain jacket. The moving average I don’t think was helped by my foolish use of too many country lanes, many in a terrible condition (which also contributed to the puncture I think). The roads between the M3 and Overton, Whitchurch and the A4 and Broad Hinton to the M4 were particularly lousy. However, the section between Marlborough and Broad Hinton was particularly scenic and a pretty good surface. Also, Chipping Sodbury and Yate provided rather welcome cycle lanes and smooth roads. More A4 next time!

By the time I got to Chipping Sodbury, the weather had degenerated to 3 degrees and heavy sleet, a good test of my wet weather set-up. This came through with flying colours: Sealskinz gloves and socks, Specialized rain jacket and Gore “Windstopper Softshell” bib tights.

The bike / Rivet Diablo / Thudbuster  definitely absorbed the bumps better than the Sirrus, but I still had a little saddle soreness, partly from the non-integral  seatpad (old) and perhaps the saddle angle (I had a go on my mum’s bike with no soreness, but getting back on mine the next day was not so pleasant). Still some work to be done.

One thing that was a massive improvement with the LSD was the brakes (which was why I got it). I no longer had to fear building up any speed in the wet, because I could be confident I could actually slow the thing down. I also didn’t end up with aching hands at the bottom of every ugly descent. Disc brakes, yes.

Back in action

After a good three months of feeling ill or my wife being horribly ill, I’ve finally gotten a ride in. Also the first trip with the Raptobike tailbox. Unfortunately, because it was only 20 miles, I didn’t really need it to carry anything. I put a rain jacket in it anyway, just because I could.

The speed wan’t as good as it has been, but the wind was strong, so I probably couldn’t have done that time on the race bike. In fact, there was a good lowracer demonstration. A “team kit” type on a road bike followed me up a 5% hill. Then we turned into the wind and only a 1% hill and the poor fellow dwindled into a tiny dot, then disappeared.

Motorway cycling

Recent BBC article that ended up on the front page of the website raised two questions with me.

The first point, which is bound to come up everywhere else in the cyclosphere is the reaction / reporting of the incident.

“You didn’t notice him until you were right up close to him. He came out of nowhere.”

Aside from sounding very SMIDSY, this ignores the fact the cyclist shouldn’t be in a position to be run into given that this chap was riding down the hard shoulder.

I’ve also never seen a front page article such as: “Person drives like a fool, has a crash, took me 3 hours to get home”.

The second point is that maybe it’s time to get people cycling on motorways. Below is a detailed analysis of the pros and cons of using motorways for cycling compared to other roads:

Road type People driving really fast Huge segregated piece of tarmac people don’t drive on Lots of junctions / side roads (where most cycling accidents occur)
City road :( / :) :( :(
A / B Road :( :( :( / :)
Motorway :( :) :)

[edit] My wife has verbally trolled me along the lines of “what about motorway junctions?”. Well, the junctions of major A-roads (which are legally cyclable) present a similar problem. Some I’ve seen use a scheme by which cyclists go down the slip road a little before crossing perpendicular to the traffic. Not sure this would work with 2-3 lane slip roads (maybe some investment in small tunnels / bridges?). However, I  stand by my “scoring” because motorway junctions tend to be further apart and the “junctions” I’m referring to are of the side road / roundabout type where SMIDSY occurs because the cyclist has right of way and is not seen / ignored.

Motorways may not be cycling Nirvanas, with slip road crossing introducing delays and getting onto motorways involving death defying roundabouts. However, once on, you would have a few miles of partially segregated “infrastructure” to ride on, so let’s not be so hard on this fellow who was finding a better way to get to work.

Bike Timeline

For fun, I recently put my bike “history” into pictorial form.

The columns represent the purposes of the bikes. Left to right: general purpose (now icy commuting & child pulling); race / commuting; recumbent and folding. I could probably justify 3 of the “strands”. The race bike I use to commute, the Brompton means I never have to use the Underground and the old MTB I use when it’s icy, fit really heavy child pulling racks etc and leave in places I’d never leave the others. The recumbents are an experiment. They look cool and may well be the best solution for a long distance, but  I don’t use them enough to really call them practical.

Bike life

Velokraft Tailbox

I took delivery of my Velokraft tailbox today (after only 4 months wait!), and a very nice piece of kit it is too. It’s about the same weight as the mudguard that needed to be removed to fit it! The nice people at Bikefix fitted it for me.

Here’s a picture of the assembled beauty, taking advantage of South West Trains’ bike space. Glad I didn’t try this at rush-hour!

Raptobike with tailbox

There was much appreciation of the box outside the shop from various recumbenteers, including a velomobile rider. Also, someone wandering about on his lunch break took the time to say, “that’s awesome” as I waited at lights.

Follow

Get every new post delivered to your Inbox.