Day Four – More Boris Bikes & Fizzbuzz

Right, day four. We began with a lecture on ‘getter’ and ‘setter’ methods which are used when we create instance variables. We also learnt how to ‘refactor’ our code by using ‘accessors.’ I won’t bore anybody by *attempting* to explain what these are. Refactoring however is when you improve your code by making small changes that don’t affect the behaviour of it. For example you could rewrite a method to make it one line instead of three. It’s all about making your code cleaner, clearer & more elegant. Making it easier to read & more understandable for the next developer who comes along.

We were also introduced to ‘Fizzbuzz’ which I had heard a lot about it from reading other Makers blogs. Fizzbuzz in essence is a game played by school children to help learn maths. You count to say, 100 and every time you reach a number that is divisible by 3 you say ‘Fizz.’ When you reach a number that is divisible by 5 you say ‘Buzz.’ When you reach a number that is divisible by 3 & 5 you say ‘Fizzbuzz.’ In terms of programming the aim is to write a program that will carry this out.

At Makers they have sort of created a challenge where you have to time yourself every time you write this program (including RSPEC testing of course!) and try to beat your last time. This is a way to try improve your coding abilities. Apparently some people can do it in under five minutes! We were told to try and attempt to do it at least once everyday and I can see it being a fun way of competing against yourself whilst also improving your coding skills under pressure (interviews anyone?!). It also helps you keep up a Github streak!

The rest of the day was dedicated to Boris Bikes and I paired with Joe. I was quite apprehensive about pairing today as I was feeling like I just wasn’t getting it. In fact at one point I was close to tears as I felt I hadn’t made any progression and I wouldn’t be able to contribute anything to the pairing experience.

By an ironic stroke of luck, Joe was pretty much in the same place as me and this is where one of my first revelations started. You would think that it would be best if you were paired with somebody who knows more than you and therefore they could teach you. Yep, this is helpful, you can learn stuff BUT sometimes you *think* you understand what they are telling you and you just nod along and it’s not till you have to do something on your own, that you realise that you don’t know what to do.

However, when it came to me and Joe, we literally didn’t understand what we were doing. Steve our ‘main coach’ (who’s very lovely) came and gave us a few pointers on the RSPEC syntax but still we were a bit stuck. What then happened is that we spent most of the day on just two problems and you know what? We learnt! We moved through each problem sooo slowly and made sure that we really got it. I got to feel the true pleasure of seeing your RSPEC tests turn green – there were definitely woops and high fives!

By 5, I had pretty much completed Boris Bikes (bar refactoring) and felt confident to have a go at my first Fizzbuzz! It wasn’t a true attempt as I had to kept on referencing the lecture but after writing the first two tests, I barely needed to look it again. I completed it in a shocking hour. Then came the second revelation – Fizzbuzz really helped me learn my RSPEC syntax! There was something about writing practically the same test over and over again that helped drill it into my head.

I started my fourth day on my biggest low and left on my biggest high so far. It goes to show that even when you are feeling in the dark, have faith, hold on, there is always light at the end of the tunnel – and that light is green! 🙂


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s