My Code Series showcases my code samples and programming methodologies with various languages and tools.

My emphasis is are as follows:

  • Code quality over speed - but speed is expected to increase over time
  • Make it work first then optimize - always review after initial solution
  • Test driven development - every line of code should be tested
  • Varying languages and tools - key to good craftsmanship
  • Unlicenced - for everyone to use and study

As a reader you should have some basic programming skills, and comfortable reading unit tests.

Jerseys (CCC 2015)

I thought I was done after the first hour until I ran CCC’s test cases. Turns out I lacked a SINGLE but necessary test case that I didn’t write.

This is much more interesting case study of TDD and how skipping a step ahead can mess you up tremendously.

Problem
Given a list of jerseys with num...

Continue reading...

Today is the first problem from CCC 2015. You’ll see quite a few code problems from there in the future. I noticed the CCC problem set tends to over complicate the problem description. Allow me to restate it in a much simpler, clearer, and easier to understand version.

Summary of Zero That Out:...

Continue reading...

Checkout

tdd code checkout

This kata comes from here.

I realized doing this post after the code was written is quite difficult, as a lot of the juicy details stuff got refactored away. So please ask me if you don’t understand any section!

Premise:

Given a bunch of items, their price per item, and a special bulk discount...

Continue reading...