Chris Worfolk's Blog


Giro d’Italia 2019

June 13th, 2019 | Distractions

For cycling fans, May marks the arrival of the first two grand tours of the season: the Tour de Yorkshire and the Giro d’Italia.

It was a polarised race this year. The first week and a half had no hills in it. The route was made up of flat sprinter stage after sprinter stage. Then it went uphill and almost never stopped going uphill. It also had three time trials.

John thought his race was over when Dumoulin had to abandon early on. However, an amazing ride by Masnada kept him competitive for the entire race. Bogdan took the early lead scoring big points with Viviani. Viviani never won any stages, but as the only sprinter any of us had brought, some high-placed finishes did the job. Like many of the sprinters, though, Viviani then went home as soon as the race went uphill.

Team Chris was not without its troubles, either. López continued to have bad luck, including getting knocked off his bike by a spectator. The UCI concluded that the punch he threw at the guy was a “human reaction” and cleared him of any wrongdoing.

Mostly, it was plain-sailing though, as Carapaz spun to victory, becoming the first Ecuadorian to win a grand tour. It was so important in Equador that the government paid for the final stage to be moved from paid satellite TV onto a free-to-air channel.

Nobody can agree when Eid is and it’s hilarious

June 10th, 2019 | Religion & Politics

Earlier this month, Ramadan ended and was celebrated by Eid al-Fitr. The problem is that a lot of the Islamic community couldn’t agree when exactly that happened. It is a common problem and illustrates some of the interesting quirks of religion.

We’re used to religions splitting apart over hairs, of course. Is transubstantiation literal or metaphorical? Can King Henry have a divorce? Did Jesus visit America and tell men to take multiple wives?

But this article by BBC News illustrates the issues with Eid, where different parts of the Scottish Muslim community celebrated on different days.

Ramadan follows the lunar calendar, with a month of fasting that ends when the new moon arrives. You may think that science could easily answer this question. We know when the new moon appears because the movement of celestial bodies can be accurately predicted. In this case, in the UK, the new moon arrived on Tuesday, 4 June.

But no.

Some argue that they have to see it themselves. Presumably, in case it disappears or something.

Others argue that because other people have seen the moon, that should be acceptable “because that’s the same moon”.

Still others have argued that seeing in the UK does not matter because the UK is not an Islamic country. Therefore, it only counts when someone in Morocco sees the new moon because that is the nearest Islamic country.

Finally, others have said the whole thing is too complex and that it should be celebrated according to what can be seen from Mecca.

Champions League final 2019

June 8th, 2019 | Sport

Britain won. Well done, Britain!

Writing tests at the API boundary isn’t as clever as you think

June 7th, 2019 | Programming

Back in the day, unit tests and code coverage were the in thing. You wrote a class, you wrote a unit test for that class. Everything was tested at an individual level and you built integration tests on top of that.

Then we realised that maintaining all of these unit tests was a massive pain in the neck, made it tedious to refactor the code and didn’t provide much value when the real business value was only concerned with everything working together so that the user being able to successfully complete a journey. So, we started writing tests to the API boundary.

Fine. Except it wasn’t fine. The problem is that per-class unit tests are really useful when it comes to understanding other people’s code.

Let’s say we have a component and it is composed of many different internal functions and classes. We write a test to the API boundary so that people can use the component and we know that it works when people use it. That is fine if you are the only person maintaining the component and you have a good memory.

But what if multiple people work on the component and somebody else needs to refactor it? You could try looking in the docs. There are unlikely to be any, though, because it is an internal function. You could try reading the code. This approach is probably the one we rely on most of the time and often works. But if often isn’t too obvious, especially in loosely typed languages with lots of callbacks (*ahem* javascript).

How do you know what goes in and comes out of a function without docs and without types? You don’t. But having a unit test demonstrating stuff being passed in and out is really useful for making an educated guess.

The Flat 100 2019

June 6th, 2019 | Sport

The Flat 100, formerly known as the Flat n Fast 100, is a sportive that starts in South Yorkshire and takes in Lincolnshire and Nottinghamshire. Last year I achieved my longest ever ride when I rode the 100km (technically a 106km) route.

This year, I was aiming for the 100 miler, which would make it my equal longest ride with the one I completed just five days before.

It was a busy event: 1,300 people registered a time. This meant the queues were big, too. I arrived at Thorne shortly after 7am but between queuing for the car park, queuing to register (the S-W surnames line was way longer than all the others) and then queuing to cross the start line meant that I didn’t get on the road until nearly 9am, almost two hours after arriving.

It was colder than expected. Foolishly, when I checked the weather, I had put in “Thorpe” rather than “Thorne”, so was surprised when it started raining. Luckily, it did so just as we arrived at the feed stop and stopped just as we were leaving. After that, it brightened up and I had to re-apply suncream at the second feed stop.

I rode with Bogdan for the first 80km before he peeled off onto the medium route. After that, I surfed a few wheels. One group kept yelling “Chris, are you there?” until I was forced to answer “yes” before pulling alongside them and explaining that I probably wasn’t the Chris they were after.

I clocked in with an average speed of 26.7 kph, which is a good pace for me, especially as I rode fairly conservatively for the first 100 km or so. The whole thing took less than six hours of cycling and 6:39 including breaks, which bodes well for The Yorkshireman.

Sapiens: A Brief History of Humankind

June 2nd, 2019 | Books

Sapiens: A Brief History of Humankind is a non-fiction book by Yuval Noah Harari.

It is the most interesting book I have read in a long time. I was ignorant of a lot of early human history. For example, I thought that homo erectus was an earlier stage of human evolution, rather than a different species of humans that sapiens killed off (or possibly interbred with).

Much of it I kind of had an idea about but it was fascinating to see it all laid out. Humans used to be in the middle of the food chain. But, 100,00 years ago, we began to hunt large game. Around 30,000-70,000 is what Harari calls the cognitive revolution. Language developed in humans alone, despite other species (parrots, whales, elephants) being able to make a large variety of sounds, too.

15,000 years ago we domesticated dogs, which is the only real evidence you need in the dogs vs cats debate. Dogs are our friends.

Whether sapiens went, we caused destruction. Australia and North America had a large variety of large mammals, for example. We killed and ate them all. This wasn’t modern man: this was the first peoples of these continents. In comparison, horses, which are often seen as an integral part of Native American life, were only introduced to America by European settlers.

The next milestone was the agricultural revolution. This wasn’t the first time we saw permanent settlements: fishing villages existed before this. But the change to agriculture meant an end of the hunter-gatherer way of life. It wasn’t a happy one: gathering is easy and produces a rich diet. Agriculture produces a poor monotonous diet and increases our workload from 30 hours per week to 40+. But it also supports more people and so the trap quickly closed shut.

Harari argues that much of culture is arbitrary: why did one religion win out, or one group of people come to dominate another? Luck, mostly. The only thing that seems to recur independently is patriarchy. We don’t know why this, but many of the reasons you may think of are deconstructed and thrown out in the book.

The author also argues that almost everything is a religion. Religions, of course, but also Humanism, and Communism, and Capitalism.

The third milestone was the scientific revolution. Although technology occasionally improved in the ancient and classical worlds, it was mostly by luck. The Romans did not have amazing technology: they were just better organised. It was only in the 16th century that the idea of experimentation and improving things just to see what was possible sprung up in Western Europe. For the first time, we started drawing maps with blank spaces in. Until then, it was assumed we already knew everything.

Until this point, Western Europe was entirely unimportant. The Middle East had been the centre of civilization for thousands of years and the economic powerhouses of the world were China and India. But embracing science and technology gave the West a huge leg up. In just a few hundred years, Western Europe came to dominate the world, and to become much richer than Asia.

Harari then turns his attention to capitalism, describing the way that states and markets have replaced families and communities. Arguably, capitalism has caused more depths than any other ideology: National Socialism and Communism killed people on purpose. But capitalism, with the slave trade, Bengal famine, etc, has killed far, far more people due to cold indifference.

All in all, this is a fascinating read. Drop what you are doing and go read it now.

Is it worth voting in the EU elections?

June 1st, 2019 | Religion & Politics

I’ve previously written about why voting in a general election is pointless. One vote never makes a difference. It did in 1886. And again in 1910. But both of those occasions were before you, me, or even my gran was born.

One of the major problems is the first past the post system. But the EU elections are run under proportional representation. So, does that make it better? It certainly does! It allows a much fairer representation of parties at the table. However, as it is done by region, and because of the number of votes, your one vote still doesn’t really make a difference.

Let’s look at my region, for example, Yorkshire and the Humber. Here is the outcome:

  • Brexit Party, 470,351 votes, 3 MEPs
  • Labour, 210,516 votes, 1 MEP
  • Liberal Democrats, 200,180 votes, 1 MEP
  • Green, 166,980 votes, 1 MEP
  • Conservatives, 92,863 votes, 0 MEPs

One of the best things about PR is that it makes the votes per MP fairer. For example, in a general election, the Lib Dems and UKIP typically have a large share of the vote while only a handful of MPs, while the SNP have very few votes but loads of MPs.

It’s not quite even in PR, but it’s better. The Brexit Party has the best ratio of votes to MEPs with 156,784 votes per MEP. So, in order for someone else to gain an MEP, they would have to beat this number.

Let’s look at what that would mean:

  • Conservatives: 63,921
  • Labour: 103,052
  • Lib Dems: 113,388

Or, maybe you want the Brexit Party to take a fourth seat. That would require them to take an additional 156,785 votes.

All of those are big numbers. Way bigger than the 23,698 votes it would require for the Conservatives to take Leeds Central away from Labour in a general election. Which they haven’t done since 1923.

I also ran the numbers against London. The closest people were the Conservatives who could have taken one of the Brexit Party seats (200,129 votes per MEP) with an additional 22,165 votes. I looked at South East England, too, where the Greens could have taken Labour’s seat with an additional 26,107 votes.

None of these results was close. One vote does not make a difference.

Sunday Assembly Leeds 2019

May 31st, 2019 | Humanism

Sunday Assembly Leeds took a break at the start of the year, with December being our last event while we changed around the format. After many long planning meetings we decided to relaunch in May with a theme of “why do we need other people?” and hosted by me.

We’ve moved to the city centre, now located in the Cosmopolitan Hotel, and we’ve played around with the format and the message. So, although our meetings look pretty similar, I think the core content of them is a lot different.

The feedback forms have so far been very positive, but we’ll see how it goes next month.

100-mile bike ride

May 30th, 2019 | Life

My training for the Yorkshireman has been a bold one: I would spend the winter and spring building power and then the late spring and early summer bringing together the endurance side of things. That meant that if the endurance wasn’t coming together, I would probably find out too late to do anything about it. That suddenly felt very scary when we arrived in May.

Luckily, it has been coming together. I completed the long route of the Tour de Yorkshire earlier this month and on bank holiday Monday I set out with the vague idea of riding somewhere between 160-180km, or shorter if I wasn’t feeling it. That isn’t a great way to structure your training but I had a 100-mile sportive booked in for the weekend after, so I wasn’t too worried about getting the distance done.

I started by meeting Cat. We went for a tour around the World Triathlon Leeds bike course and had a lovely chat. After that, I headed up towards East Keswick, not really knowing where I was going: just setting out with a map and a pocket full of dreams.

I made great process heading out towards York which always makes me suspicious: if you are going faster than you expect, it is often because you are benefiting from a tailwind you haven’t noticed. As soon as I turned back I ended up hitting the ever-present headwind which made it much harder going.

My back was giving me all kind of grief and by the time I hade it to Otley, my legs were fed up. They cried every time we got near any kind of incline. I made it as far as Golden Acre Park before refilling my bidons with coke for some sugary caffeine energy. Finally, at the bottom of Kirkstall Road, I hit the 160km mark (100 miles).

Ice hockey world championships 2019

May 29th, 2019 | Sport

I’m sure that in your house, like ours, May is all about the ice hockey world championships. It has been a superb year for both Britain and Finland.

Two years ago, Britain was in the third division. But, having won their division two years running, they found themselves in the top tier playing countries that actually play ice hockey. There are two groups of eight with the bottom from each being related and it was always going to be a struggle to stay up.

The initial scorelines were predictable: 3-1 to Germany, 8-0 to Canada, 9-0 to Denmark and 5-0 to Finland. The only people we seriously scored against were the US, who still beat us 5-3. It came down to the final game: Britain vs France. The loser was going down, and France had been in the top division for a while.

In the second period, France took a 3-0 lead. Surely it was all over? But then Dowd found the back of the net for Britain. And them Hammond. The third period started 3-2. Farmer brought us level in the third period and we went into overtime and then bang! Davies puts an overtime winner past France to keep us up.

Meanwhile, Finland easily made it through the group stage as usual. They came second, behind Canada, despite having beaten them, due to wobbles against Germany and the US. The route to the final was no easy path: there are four good ice hockey teams in the world and Finland had to beat them all.

It started with a 5-4 overtime win against Sweden in the quarterfinals. Next up: Russia, with the sole goal producing a 1-0 win for Finland. Finally, the final itself. Having beaten the 3rd and 2nd ranked teams in the world, they now had to take on the 1st.

Canada started well, taking a 1-0 lead in the first quarter. But Finland was not out: Anttila, who scored the winner against Russia in the semi-final, brought Finland level in the second period. Two minutes in period 3, he scored again! With five minutes to go, Pesonen scored to give Finland a 3-1 lead. Canada immediately pulled their goalie but it was no good. Finland took their third world championship!