Becoming an 8th Light Apprentice


Having successfully completed Code Platoon, I am now completing my second week at 8th Light!

I’ve been tasked with learning my first strongly typed language - C#. After getting the .NET Core SDK installed to use with Visual Studio Code, and completing a quick “Hello World”, I started working through some Koans to introduce me to the language. Koans are essentially a set of simple problems where you are asked to “fill in the blanks”. They look a lot like unit tests, and present a lot of prewritten code.

I followed Bobby Johnson’s repo which you can check out here. He also wrote a short article explaining how he came to love koans, and why he created a set for .NET/C#. Bobby’s koans introduced me to xUnit - one of C#’s testing suites and encouraged a TDD style of thinking. I found the Koans very helpful - they highlighted the small differences between languages I already know and prompted me to research areas that were completely new to me!

This week I have been working on a Coin Changer Kata. The basic premise is:

Produce the minimal amount of change for a given amount. For instance, If the input is: 99 cents of a dollar, the output should be: 3 quarters, 2 dimes, and 4 pennies The output can be something as simple as 25, 25, 25, 10, 10, 1, 1, 1, 1 which is the same as 99 cents.

I’m currently reading Understanding the Four Rules of Simple Design by Corey Haines. I tried to approach Kata with the 4 rules in mind. Initially practicing TDD - building each test and then making it pass, until I had something that satisfied the requirements, albeit rather ugly. I then refactored, modifing the data structures whilst considering how the end user may want to obtain data. I tried to not be afraid to delete code. I went through 5 revisions, playing around with different ways of calculating the correct coins and how they are stored/returned. View my code here.

Today I will be reviewing my code with my mentor and getting feedback on what I have been working on!

Back to blog