Potential social benefits of the coronavirus pandemic

With the UK and many other countries around the world in lockdown to try and prevent the spread of the coronavirus pandemic, it can seem like a pretty bleak time to be alive. But I’ve been thinking about some of the potential positives that could emerge from this pandemic that would benefit society as a whole.

Working from home will become more widely embraced

For jobs that people are doing at home during the pandemic, Employers will realise that they get the same if not better results from the employees that are remote working. Companies will realise that they can save money by scaling back the size of offices and allowing people to work from home.

After the pandemic, the office can become somewhere you can work from every day, if you like the company of others and the focus of the office environment. Or you can just pop in occasionally for meetings and catch ups.

Flexible work schedules

When companies allow people to work from home they need to trust their employees to manage their own workload. This leads to happier and more productive employees, and better retention. A natural result of this trust is that the employee can set their own work hours.

Companies will look at results rather than hours worked

This is a natural progression from flexible working. Where it makes sense, companies will stop worrying about how many hours their employees are working, and instead look at the results they’re getting for the company. This is a win for the company, managers can spend less time micromanaging and more time setting the higher level goals and direction for teams in the company.

NHS will get the funding it deserves

The single most important action we can all take, in fighting coronavirus, is to stay at home in order to protect the NHS and save lives.1

Stay at home. Protect the NHS. Save lives. It’s a classic Boris Johnson tagline. Its memorable, the order of the sentences doesn’t even matter!. Let’s hope it’s as effective as his previous ones.

The NHS is under a huge amount of pressure currently, and the government are now asking for 250,000 volunteers to help the 1.5 million people who have been told to self isolate for 12 weeks. Let’s hope this all leads to the NHS getting the funding it needs and deserves to become a thriving first class national health system. Or at least moves things in that direction.

Climate will benefit from the reduction in activity

There’s already evidence2 that the coronavirus pandemic is having positive effects on the environment. Let’s hope scientists are able to get enough data to prove that the benefits of human (in)action during the pandemic helped to slow or even reverse climate change.

Home delivery from supermarkets will be more common

This will help keep cars off the road. Getting your shopping delivered is better for the environment than driving to the supermarket. One van can deliver multiple people’s shopping, which means quieter roads and fewer emissions.

Veg box delivery schemes will see a boost in numbers

More people will see the benefits of getting delicious, local, organic produce from the various veg box delivery schemes that are currently seeing unprecedented demand. Because these schemes are local and delivered to your door these schemes are also good for fighting climate change.

People take up running

This is one of the very few remaining sports that people can now do outside their house for their daily exercise. I was very sceptical about running for many years, but I started running in almost two years ago and can’t understand why I didn’t start sooner. It’s a great way to build up a sweat and let your brain go onto autopilot for a bit. Running is well known for it’s benefits to mental health as well as physical health, and in these testing times anything that helps with our mental health is welcome.

Video calls with family more frequent

Outside of work I haven’t been a huge video call user until now. But I’ve used it multiple times in the past few days to let our daughter talk to her grandparents while we’re in lockdown. While video calling still has its flaws, it’s a great way to keep in touch with people you’re unable to see. Hopefully this will mean more people staying in touch via video call in the future.

Working from home tips

There are a lot of working from home posts doing the rounds at the moment. I’ve been working from home for nearly seven years, so I thought I’d write down my tips for working from home.

Go outside

My top tip for working from home is make sure you don’t stay at home all day. That way lies madness. You need to get some daylight, it will help you feel fresher and more focussed. Studies1 show that exposure to daylight can help you sleep better at night as well.

Leave the house and go for a walk. Once mid-morning, and again mid-afternoon, bonus if you go lunchtime as well.

Get up and walk around the house regularly. If you have a garden or outdoor space and the weather is nice then sit out there with a notebook and do a brain dump.

Do some form of physical exercise that makes you sweat most days. Sitting at a desk doesn’t get the heart rate going anywhere near enough.

Communication

Over-communicate. People don’t know what you’re doing, so make sure you’re extra visible.

Don’t be afraid to ask people questions if you’re stuck. Ideally your communication channels should be asynchronous, so you don’t have to worry about interrupting people, they’ll get back to you when they reach a convenient stopping point.

Stay hydrated

When there’s no-one offering you regular tea and coffee it’s easy to forget to drink anything.

Hide the snacks

Ideally don’t have snacks in the house in the first place. They’re far too tempting.

Meditate

I try to meditate every morning, it helps me to feel less stressed and anxious.

FiraCode

I came across FiraCode today. It calls itself a “monospaced font with programming ligatures”. What that means is when you install this font and configure you text editor correctly, it will render things like ->, <= or := as a single token. In theory this makes it easier to read code, because you don’t have to read two characters for a single token.

Whether or not it actually makes it easier to read code remains to be seen. I’ve installed the font on my machine and configured iTerm and VS Code to use the font, so I’ll give it a try for a few weeks and see if I notice any difference.

Ruby's Time vs DateTime classes

Ruby has two classes, Time 1 and DateTime, that look quite similar at a glance. They both have methods for dealing with dates and times. Which should you choose when you need to work with dates and times in Ruby?

It’s a common misconception that William Shakespeare and Miguel de Cervantes died on the same day in history - so much so that UNESCO named April 23 as World Book Day because of this fact. However, because England hadn’t yet adopted the Gregorian Calendar Reform (and wouldn’t until 1752) their deaths are actually 10 days apart. Since Ruby’s Time class implements a proleptic Gregorian calendar and has no concept of calendar reform there’s no way to express this with Time objects. This is where DateTime steps in:

shakespeare = DateTime.iso8601('1616-04-23', Date::ENGLAND)
 #=> Tue, 23 Apr 1616 00:00:00 +0000
cervantes = DateTime.iso8601('1616-04-23', Date::ITALY)
 #=> Sat, 23 Apr 1616 00:00:00 +0000

Already you can see something is weird - the days of the week are different. Taking this further:

cervantes == shakespeare
 #=> false
(shakespeare - cervantes).to_i
 #=> 10

This shows that in fact they died 10 days apart (in reality 11 days since Cervantes died a day earlier but was buried on the 23rd). We can see the actual date of Shakespeare’s death by using the gregorian method to convert it:

shakespeare.gregorian
 #=> Tue, 03 May 1616 00:00:00 +0000 So there's an argument that all the celebrations that take place on the 23rd April in Stratford-upon-Avon are actually the wrong date since England is now using the Gregorian calendar. You can see why when we transition across the reform date boundary:

# start off with the anniversary of Shakespeare's birth in 1751
shakespeare = DateTime.iso8601('1751-04-23', Date::ENGLAND)
 #=> Tue, 23 Apr 1751 00:00:00 +0000

# add 366 days since 1752 is a leap year and April 23 is after February 29
shakespeare + 366
 #=> Thu, 23 Apr 1752 00:00:00 +0000

# add another 365 days to take us to the anniversary in 1753
shakespeare + 366 + 365
 #=> Fri, 04 May 1753 00:00:00 +0000

As you can see, if we’re accurately tracking the number of solar years since Shakespeare’s birthday then the correct anniversary date would be the 4th May and not the 23rd April.

So when should you use DateTime in Ruby and when should you use Time? Almost certainly you’ll want to use Time since your app is probably dealing with current dates and times. However, if you need to deal with dates and times in a historical context you’ll want to use DateTime to avoid making the same mistakes as UNESCO. If you also have to deal with timezones then best of luck - just bear in mind that you’ll probably be dealing with local solar times, since it wasn’t until the 19th century that the introduction of the railways necessitated the need for Standard Time and eventually timezones.

From “When should you use DateTime and when should you use Time?” in the Ruby stdlib DateTime documentation.

Summary

  • Use Time when dealing with near-past, present or future dates. It can technically represent dates from 1823-11-12 to 2116-02-20.
  • Use DateTime when you want to accurately model distant past dates, like Shakespeare’s birthday.
  • So for most applications use Time.
  1. There are actually two Time classes, one in core and one in the standard library which you get when you or one of your dependencies does a require 'time'

It gets easier

It gets easier. Every day it gets a little easier. But you’ve got to do it every day. That’s the hard part. But it does get easier.

– Jogging Baboon from Bojack Horseman

The Jogging Baboon says this to Bojack after Bojack has collapsed while running in “Out to Sea” (S02E12), right at the end of the episode, which is also the end of season 2.

I think this quote applies to learning all kinds of new skill. Persistence pays off.

Early wild garlic

Young wild garlic shoots

Found some young wild garlic shoots while out walking yesterday.

Seems very early in the year for them to already be this big, but it has been a very mild winter so far.

Start with the command line

Screenshot of the iTerm terminal emulator with zsh prompt

When starting a new project it’s tempting to reach for a web framework straight away. But I think it’s good to resist that urge. Start with the simplest thing that could possibly work. Start with the command line.

If you start with the command line then you can cut straight to the heart of the problem and solve the interesting bits first. Then once you understand what’s needed it can be translated to a web app or smartphone app or whatever.

subscribe via RSS