Monday, 28 March 2022

Learning at the right time

A few years ago I wrote about practical life lessons learned from playing Dungeons & Dragons. Many roleplaying systems handle the advancement of character skills with a level system. Over time your character gains experience and when you reach a set threshold you gain a "level", which is a collection of abilities and skills. Your choice of character class defines the set of abilities you gain.

So far, so simple. Many years ago, I was playing in a game in which we were forced to enact a dangerous escape in a spaceship. My character was the most competent pilot in the group, which meant he had enough knowledge for the ship to not immediately drop out of the sky. A few very lucky dice rolls, and a suicidal ramming of another ship later and we limped out of the gravity well, escaping to hyperspace in what was left of the ship. Much fun was had, and I gained a level - which I used to improve my piloting skills. Immediately AFTER I needed them.

That scenario never came up again, of course.

In my experience, this is very common in roleplaying games - spend the time learning skills for a scenario that has already occurred. It's also something I see all too often in work. People learning about change management immediately after a change, for instance, or about HR processes immediately after struggling through a difficult piece of casework. In technical delivery, learning how to use a frontend framework properly after releasing an accessibility nightmare onto the public or how to monitor your service on $cloudProvider after implementing their new and shiny features and deploying using it.

I've done this myself many times. So why is it so hard to look forward and learn skills ahead of time? The broad-brush problems should be very predictable. Technical strategy should show which skills are going to be needed in the next six months and longer. Moving into a management role makes change management and some kind of HR process work pretty much guaranteed. For me, there are a couple of problems at play.

Firstly, management work can be far too reactive. More than that - being reactive is actually very seductive as it feels far more productive. It isn't; but the feeling of being needed because you're putting out fires is highly addictive, especially shortly after coming from a discipline with a strong way of defining productivity such as development. I spent most of my early days after moving into leadership trying to force myself onto the front foot so I could actually think ahead instead of running around fixing problems and if I'm honest I didn't really want to make this change.

Secondly, even when there is a chance to look forward we often don't actually have a chance to act on what we see. I know that dedicating hours to studying various aspects of management and reading supporting books will help me, but I certainly don't have the time to do it without making serious compromises in what I have to deliver or just consuming my non-working time. Neither of these solutions are acceptable. Part of this is about having any spare time during the working day, and to study there is a need for some quiet reflective time which is particularly difficult when everyone is trying to reach you for whatever Opinion is needed at that time. But also, I need to give myself permission to study and acknowledge that this is part of the job.

What should we expect from leadership? There are times of difficulties and change, but in general I think it's reasonable for people to expect some form of considered development from their place of work. In these enlightened times, we've moved past "bring them in and use them up" as a management style (insert correct cynicism here) and certainly in a knowledge-based job like development, constantly building skills is essential for an individual's future, as well as of benefit to the organisation. Not to mention retention and in-house skill development is far more cost effective than hiring and firing in this sector. This leads straight to an obvious point - we should be building organisations which value learning, and that means making time and expertise available. For those of us who talk about taking on apprentices and other "learning" roles (which done wrong can destroy someone's career as it starts) the point is that much stronger.

So what is the key thing to learn here? Well, it's important to look forward rather than backwards when deciding what to study. Beyond that, it's a well-rehearsed refrain at this point. Scanning the horizon is fundamental to a successful leadership role. Acting on what one sees there is essential. Both of these require time and carving out time is hard. However there is an extra thought here - giving oneself permission to find and spend time on learning is an important step, and being able to do so is part of the organisation's culture. This is important for anyone, but especially in a position of leadership where one can have a strong voice setting that culture and enabling others to grow.

Sunday, 13 February 2022

Upgrading to Rails 7

I run some simple Rails applications which I keep upgraded. I recently upgraded Ruby and Rails versions and since it's upgrade season, I'm making a note of my experiences ready for the next application I do, and on the off-chance it can help other people get started. And a reminder that I do do technical things occasionally, honest.

To note - this is a very simple Rails application, so only covers the basic gotchas I experienced. It was an app originally written in Ruby 2 / Rails 5 and in this iteration is now being upgraded from Ruby 2.7 / Rails 6 to Ruby 3 / Rails 7. The code is stored in a repository in Github, with CI done both via Github Actions and Codeship and deployment to Heroku.

Ruby upgrade

Good news! The Ruby upgrade (2.7.2 to 3.0.3) caused no problems at all, although I did need to update my Codeship config to remove the explicit installation of Bundler in my setup script.

Rails upgrade

I made use of the Rails upgrade guide - in particular I bounced the version of Rails in my Gemfile from 6 to 7 then ran bundle exec rails app:update which introduced the usual ton of rubocop violations but also created some migrations acting on some tables which didn't actually exist.

These were ActiveStorage tables so I needed to create them with bundle exec rails active_storage:install then rearrange the migrations to get them to work (ie put the creation migration before the modify migrations). I probably could have eliminated the new migrations since I'm not using this function, but it seems there are other references to these tables. It looks like Rails expects these tables to exist, and the lazy option was to create it and be on the standard path. So I was lazy. Those migration do not include timestamps, so I had to add those to appease the linter.

Second show-stopping problem - Rails 7.0.2.1 was a trap. It turns out there was a bug in ActiveSupport which manifested in a variety of different ways. For me, it stopped almost all automated tests working. It was reported and fixed quickly but did manage to cost me a chunk of time trying to figure out what was going on... Anyway, the simple fix is to use Rails 7.0.2.2 instead.

Now fixing some deprecation warnings. action_cable has been renamed to actioncable and this will escalate to a breaking change in Rails 8 so this needs updating in app/assets/javascripts/cable.js.

Also, I was getting references to using older (Rails 5.1) CSRF protection behaviour. There are a load of defaults which are version locked in config/application.rb and these can be upgraded with config.load_defaults 7.0 as per the upgrade guide.

Locally, this was all that was required however when I deployed to production, the heroku build failed at bundle exec rake assets:precompile. Uglifier needed ES6 syntax enabling, with config.assets.js_compressor = Uglifier.new(harmony: true) in config/environments/production.rb.

And that was it! As I said, a very simple application so I'm sure I avoided much of the upgrade pain but I've noted my experiences here to help others get started.

All these changes are captured in a pair of pull requests:

Monday, 31 January 2022

Recovering a sense of wonder

For the last few years I've started the year with a post about how January is bad and I want to reboot the year. This year is going to be different. While I could certainly be having a better time (as could many) I'm facing 2020 round 3 with a sense of cautious optimism.

I spent a lot of time over the Christmas period reflecting on what has changed for me over the last few years and one thing that I think I've lost is my sense of wonder. That childlike sense of feeling the magic in the world, revelling in something small but infinitely complex, and enjoying the feeling that I can explore something and there will always be more to learn.

I say lost - I think I prefer to think "misplaced".

This isn't the kind of thing that I can analyse and come up with a formula for change. It is not something that will come from deliberate action. That said, while there isn't a "solution" here, some deliberate steps can lead in the right direction.

On reflection, what I'm really missing is what comes before - that level of contentment and general feeling of peace when I'm open to the world and new experiences. There are several active things I can work towards, but at the heart of it for me really is personal space. Odd to reflect on after nearly two years of being pretty much entirely alone. That space is better called "free time" - those moments when I don't have some pressure on me to do something. Pressure from real work, volunteer work, paperwork, need to write a blog post, put up pictures, etc. In those free moments I can pick something up (literally or metaphorically), look at it, turn it over and actually experience it. I can engage with something in more than a facile way before rushing off to the next thing, and I can take the opportunity to see the beauty and wonder in it.

So this year, I'm going to invest time carefully. I'm going to try to only do things I actually want to do, minimise the things I have to do and avoid being pushed into doing things I don't want to do. I want to keep my time precious, so I can put more space around the things I enjoy - and by that I mean take the time to enjoy things properly. I'd also like to actually finish some things. While I don't want to be ruled by todo lists, I do actually get something from completing a task and putting a line through it. There are some things on my "want to do" list that have been there waaaay too long and it would be nice to make some progress in the areas I've identified as things I actually want to do.

More than anything, I need to relearn how to Enjoy the Thing. Through that I think I'll start the see the beauty in the world again and that is the route back to wonder I feel.

Friday, 31 December 2021

The year that was, 2021

Good grief. Astonishingly, 2021 was a year that happened. Even better, it ended. As I start writing this post, I am honestly struggling to think of anything I've done this year however long-term readers will know that that is exactly the point of this annual post. I also don't write about work (until I do) which is going to be a big deal this year. So, with that in mind, what HAVE I done this year that isn't all Deep Rock Galactic and Dark Souls 3?

  • 13 posts on this blog (14 including this one) - seventh consecutive year of a post per month
  • another year of the Year in Pictures site - this is the seventh year and we're up to 33 photographers
  • 264 contributions on Github - down on last year, but better than I expected
  • started writing a new D&D setting
  • got back into gaming (including finally understanding the appeal of and completing Dark Souls 3)
  • made a point to read a lot more than 2020 - important since I've lost my train journey reading time
  • did a lot more cooking - both learning and keeping it regular
  • attended a cooking class (and learned about sauces)
  • learned a bit more video editing - made a birthday video for Matt and a tour of my Valheim home
  • increased exercise and felt it actually start to do something
  • made a colour changing potion
  • learned how to use a multimeter
  • bought some lightsabers!
  • finally started building some LEGO
  • upgraded my home network with a UniFi Dream Machine
  • made a book
  • extensive Instagramming
  • loads of photos on my Flickr stream

Resolution count - 6.5/10. It's getting better, but I'm aware I made them easier this year as I was expecting a tough year...

Looking over these, I am once again pretty amazed I got anything done. However I notice most of these kicked in towards the end of the year, when Significant Events happened (more on that later). This could be classic memory bias, but I've spent some time thinking about it and this does seem to be a fair reflection of the year. I really did very little other than work for the first seven or eight months of the year.

So, speaking of work... Every year I say some variation of "this year has been too much about work but next year will change" and every year it gets worse. This year has been no exception - work has been all-consuming in a whole variety of different ways. However, this year I can genuinely say I've made a change. I left my job in the Civil Service. I've written about it before, and I'm sure I will do again so for now I'll note that it was a tremendously emotional decision and I have since realised quite how burnt out I really was. Since then, I've also set up a company (Third Way Digital) for all your digital leadership consulting and engineering needs and have taken my first steps working with a few different places.

And now for 2022. I'll say again (again) that next year will not be all about work. However, if I'm honest, I just don't know. Self-employed consultancy is a whole new game for me and maybe I'll be working really hard all year? Maybe I'll have nothing but time? I'm not sure which I'm hoping for, but a balance would be nice.

Other than work, I think it's time for some changes. We've all been stuck inside, looking inwards and not engaging with each other enough for nearly two years and for me that needs to change. I want to be looking outward this coming year. Whether it's in person, or via video call, I want to be more involved with other people in a healthy and constructive way. If you know me, expect a call.

I also want to be more creative. The last few months of 2021 saw me recovering and starting to indulge in creative projects. I want to keep that going and increase it significantly. I used to do a lot of making and I want to find that space again. I was set a challenge:
"I dreamt that you had built a mechanical light up version of the old school Channel 4 logo, which was on display somewhere, but as I was looking at it and going "omg Tom made this why didn't he tell us?!" a curator knocked it over and it smashed."
Good idea dream-me. However you're making me look bad, so you're going down.

My new year resolutions support these, however more than anything I want to find and restore my sense of wonder. I am naturally a pragmatic cynic, however until this year I've also retained a sense of wonder for the world. This year I think I lost it - or at least misplaced it. However what was lost can be found. That's 2022. From that restores an interest, and a general zest for life.

Let's do this.

Saturday, 18 December 2021

A Christmas PSA

If, like me, you sometimes brave the horrors of the local Waitrose supermarket then you may find yourself stuck behind increasingly long queues of people. While it is lovely being around grumpy people during a pandemic, there is a shortcut to getting out.

You'll need a Waitrose card. Head over to the completely ignored QuickCheck stand then scan out a handset. 20 seconds of scanning your stuff later, you can waltz up to the entirely unused QuickCheck checkouts, scan your handset, pay and head for the door.

If something doesn't scan, you can convert the terminal into a self checkout for that item. Or indeed most of your items if you're really feeling like trolling everyone around you.

Either way, it is much quicker than the queues and leaves you with time to bask in the naked hatred of all those you've just walked straight past. Glorious.

Other supermarkets are also available.

Sunday, 12 December 2021

Responsible Building

This has happened before, but it continues to amuse (and scare) me when a decent quote or blog post crosses my desk and when I look up the author it turns out to be me of the past.

Today I was sent a statement about sustainable and responsible building, which I am mostly reproducing here for the sake of posterity:

For me, building responsibly means thinking about the future by making careful and sometimes difficult decisions in the present. What we build today should be simple and documented, because tomorrow we are going to need to understand it. What we build today should be designed well, because tomorrow we are going to need to add features. What we build today should be well tested, because tomorrow we are going to need to modify it with confidence. 

It also applies to our working practices. Are we pushing ourselves to the point of future burnout? Are we building too much, beyond what we can maintain? Are we showing respect for ourselves and those who come after us? Ultimately, are we proud to invite new people into our working environment?

The quote was originally on the Inside GOV.UK blog back in 2017 and comes with a picture of a (sadly much thinner) me looking sweet and naive, before being ground down by The World for four long years.

Would I change anything here? Not much to be honest. The points are foundational rather than hugely challenging. They talk about people, although I would invert the priority these days. The only thing I missed was the environmental impact of any built systems. So good job, past me.

There is also the topic of ethics in software engineering - something I've written lots about, but not posted because I'm struggling to get it down in a coherent way. The original context of the question did not really invite comment in that area, but a more general statement about responsible engineering should definitely discuss whether one should do something, as well as whether one can.

Anyway, this is a short post mostly to capture that quote here.

Tuesday, 30 November 2021

I am bad at resting

So it turns out I'm really bad at resting. It has been about a month and a half since I left the Civil Service and went out into the cold, unforgiving world with nary a plan to my name except to relax, calm down and find out who I am when I am not consumed by work. Except, of course, I did have a plan and a long list of contacts to talk with along the way.

My standard day is to get up (much earlier these days - a very positive sign!) and spend the morning on calls with friends in the industry and recruiters. Many of these are advice-and-discussion calls, which fulfil most criteria for being called Work, other than being paid. Then I make some lunch and spend the afternoon drinking coffee while reading something edifying (a book on depression here, a white paper on approaches to building a digital organisation there...) or writing some code before some cooking and the evening. It's actually very pleasant but is rather reminiscent of a gentle working day rather than a total break. While I am doing some LEGO and other minor crafts, I haven't dived into a totally new life or anything.

So to fix this, I did something different. I set up a company. To enable working. Sigh.

I often write posts for this blog by pondering my own behaviour from an external perspective and sometimes I end up wondering what on earth I am doing. On this occasion, and joking aside, I am finding this all raises an important question. What does "relaxed" actually mean for me? See, I can rationalise looking at work again so soon by writing about arising opportunity (and especially when they tie in neatly with my plans) but the fact is that I know my sense of self is overly defined by my work and I genuinely am not good at relaxing or unplugging. This is a bit of a problem since the answer to the question "who am I if I'm not working" appears to be "someone who is trying to work". Not healthy, and not a good idea.

I can, of course, make excuses. Some of the things I want to try are hard during COVID / while I live on the top floor / don't have a car / etc etc. While these may well be genuine excuses (it's hard to run a lathe in a 1 bed flat) they feel a bit tactical, which means I'm asking myself the wrong question - or rather dodging the right question. It's not about who am I without work - I always knew the answer to that would be a bit empty - it's about who do I WANT to be. 

The problem with questions like this (similarly "where do I want to be in five years, and if I do nothing will I be happy with how I've spent five years?") is that they are about making decisions then deploying effort to effect change. Coming into this period I had very little energy. I needed a rest, and that meant retreating to my comfort zone not trying to become some new enlightened being. However my comfort zone turns out to be rather like working and thus the problem cycle continues.

And I am still dodging the most important question - who do I want to be? And the answer is ... I don't know.

There are some components. When I close my eyes and imagine, I see someone who looks different. Someone who is secure in themselves. Someone will skills. Oddly, not the ones I already have - I don't know if this means I take myself for granted, or if (more likely I think) I don't really value my own skills. I do have a deep-rooted assumption that if I can do it, it can't be that hard (ideal attitude for consulting...) which may explain this picture.

So, this suggests a few courses of action. First, I need to recognise and respect my own abilities. When I close my eyes and see this person I want to be, I need to make sure I see the bits I've already done in that picture. I need to recognise that while I always want to learn new things and be a bit different, there is an awful lot I do not want to just discard. Next up, I need to look at the differences and decide where to act. As I wrote above, I do not have boundless energy at the moment so I need to be careful and precise about what I try and what I don't and along the way, I need to rediscover my love of learning and trying (there is another post in that, but that's another day).

So in the short term it's back to the gym for me. Then, I think what I really need is to rediscover a middle gear. A mode where I can be energetic and inquisitive, but without being full "on" so I can learn new things without it feeling like a chore, and practice new skills without a ongoing fear of failure. The "how" is something to ponder, but keeping flexible time has got to be a part of it.

Of course, with Christmas coming I've got something else to help me continue hiding from all this...