Wednesday — Week Ten

We had another tech test today, and again it was a lot of fun. I still can’t believe how much I enjoy what I’m doing. I can’t believe that sometime soon (hopefully sooner rather than later) I’ll be getting paid to do this!

The kata we did was called Gilded Rose, which is apparently a really well known kata. This one is an existing codebase that you need to test, refactor and extend. I implemented mine a bit differently to a few people that I talked to, but I’m pretty happy with how I did it.

Here’s the original code base (I did it in Ruby)

Essentially, there is an ‘inn’ (seems more like a shop to me) that sells different items, and their ‘quality’ changes each day based on the item.

I chose to do it as object oriented as I could, and made different classes for each of the different items. One of the tough things is that you can’t make any changes to the ‘item’ class, which meant that I had some of the logic for ‘items’ in a different class which I didn’t like.

Here’s my code, which in my opinion is probably the best refactoring I’ve ever done.That’s not to say there’s still a lot I’d like to do!

After the code review, we had another cohort catch up with Dana, where everyone who wanted to got a chance to talk about how they were feeling. Like last time, this was an awesome experience, and I’m so proud of so many of my cohort who really opened up. I’m going to miss these people so much.

This evening I went to a catch up with some ex LGBT+ makers students which was really fun. I haven’t really made friends in London outside of my cohort, so it was epic talking to some other like minded people.

It was so nice talking to graduates who are in the industry and love their jobs. I can’t wait until that is me!

Things I learned

  • Duck typing — game changer!
  • A few clever ways of extracting some functions from methods
  • Refactoring can be super fun
  • Networking can be fun

Things I want to focus on

  • More clever things like duck typing — I’d love to be able to write more code like that!

Things I’m struggling with

  • Doubles —I’m about 85% happy with my tech test, but I couldn’t get doubles to work and removed them in the end… I feel like I keep typing that I need to focus on doubles but run out of time. Can anyone recommend some really good resources?