From the Inside January/February 2017
Let's say you are a rock star or a professional athlete. You have talent. More than that, you are a master of your craft. Performing — onstage or on the playing field — is the practical demonstration of what you can do. Despite the hours you spend playing in public, you are still required to practice, practice, practice in private.
Let's say you are a programmer. Do you think you are a good coder? Ask yourself: Have I been practicing coding, or have I just been doing my job? Most of us assume that our day-to-day software development is our practice. But this is not the case. If day-to-day software development is like an NBA game - because that's where we make our money - it is clearly showtime and not practice. Basketball players use the time between games to improve their jump shots, layups, and passing. They do this for the purpose of increasing their skills and performance during the games. This is what you, as developers, also need to do.
One way to do this is to perform Code Katas. The term was coined by Dave Thomas, co-author of the book The "Pragmatic Programmer." A Code Kata is an exercise in programming which helps you hone your skills. Although they were not designed with MultiValue in mind, they are a good fit. Let's go through one together.
Here's Dave's first Code Kata (for pricing goods at supermarkets) found at: http://codekata.pragprog.com/2007/01/code_kata_one_s.html
Kata One - Supermarket Pricing
Some things in supermarkets have simple prices: this can of beans costs $0.65. Other things have more complex prices. For example:
Three for a dollar (so what's the price if I buy four or five?)
$1.99 per pound (so what do four ounces cost?)
Buy two, get one free (so does the third item have a price?)
This Kata involves no coding. The exercise is to experiment with various models for representing money and prices that are flexible enough to deal with these (and other) pricing schemes, and at the same time are generally usable (at the checkout, for stock management, order entry, and so on). It would be beneficial to us if we spent some time considering issues such as:
Does fractional money exist?
When (if ever) does rounding take place?
How do you keep an audit trail of pricing decisions (and do you need to)?
Are costs and prices the same class of thing?
If a shelf of 100 cans is priced using "buy two, get one free," how do you value the stock?
More often than not, the requirements of our day job won't parallel our needs when it comes to growing our skills for the future. The way to get ahead of the curve, and to keep our minds fresh, is to look for side projects, for practice exercises, or any other excuse to stretch and improve. Do that, and you are a rock star.