Welcome Guest | My Membership | Login

From the Inside January/February 2017


Article

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.

 

# # #          # # #          # # #

 

Related Articles

  • Augmented Reality in Business

    Many technological advancements have created new ways of doing business. Some are obvious, like the impact of the spreadsheet or the word processor. With Augmented Reality (AR), the business case is less clear. This article will talk about how Augmented Reality will be used in business and some of what sort of software changes you can expect.

  • UX/UI Part II: Assumptions

    Company: HDWP

    Interfaces work, or fail, based on agreed reality. The challenge isn't solely about languages. It has to do with culture, generational changes, and real world experience. Computer programming is a dialog between the programmer and the user. Let's start questioning the assumptions we make in creating our conversations.

  • IS.HASH.MD5 Generating MD5 Values with Generic MultiValue BASIC

    The MD5 message-digest algorithm is a widely used cryptographic hash function producing a 128-bit (16-byte) hash value, typically expressed in text format as a 32-digit hexadecimal number. MD5 has been utilized in a wide variety of cryptographic applications and is also commonly used to verify data integrity.

  • Email from U2 Hold Files as PDFs

    Database: UniVerse

    Printing is only one way to share reports. Felix provides code for re-inventing hold files as PDFs and as email.

  • From The Inside Jan/Feb 2011

    Company: International Spectrum

    New Year, New Features, New Resources, New Formats… We have a lot of new things and changes happening this year; one is the magazine. One of the big pushes this year is to make the magazine more digital friendly. As a start, you'll see QR Codes on each article. 1


Return to top