December Meeting Summary

This week we had our December meeting, which included a bunch of new faces.  There were about 16 or 17 people in attendance, and we started the meeting off after some general network with a “lightning” talk by Kevin Kuebler on the subject of F# and how he’s been using it in a project of his.  F# was new to a lot of members and there were a number of questions as well as some feedback that this is a pretty cool language to check out, so I’d say the talk was a success.

After Kevin’s talk, we had pizza and spent about half an hour on Open Spaces style discussion, with the main two topics being Silverlight 4 / WPF and Acceptance Testing.

At 7pm, we started our kata/exercises portion of the meeting.  For this meeting we focused on slight variations of the Supermarket Pricing Kata.  We started out by breaking up into groups of 3-5 people and spent about 30 minutes discussing how we would model pricing of Supermarket items such that a cash register could ring up items one by one.  Pricing rules included things like:

  • Chips are $3 per bag.
  • Apples are $2 per pound.
  • Cereal is $3 per box, but $4 for $10.
  • Ice Cream is Buy 2 Get 1 Free.

After 20 minutes or so, each group presented to the rest on how they approached the problem.  It was interesting to see the varying assumptions that were made, such as whether or not it was a requirement to be able to show the price of each individual item as it was scanned, versus merely being able to show the price to the customer once everything in their cart had been scanned.  A field trip to a local grocery store was suggested in order to get a reality check on which was the more likely use case.

Following the discussion, we broke up into pairs (splitting up people who knew each other so everyone worked with new people) to work on the problem with a couple of simple requirements thrown in for the application.  I know some people worked on the project in Python and others in C# (and of course others may have been using other platforms).  The requirements included the pricing rules above, along with:

  • A Register class should support an AddItem() method that takes in either an item (id, name, upc, whatever) alone, or an item and a quantity.  The AddItem() method should return messages that can be displayed in real time to the customer showing the price of the item and any appropriate discount(s).  (i.e. a collection of messages that can render as strings).
  • The Register should have a PrintReceipt() method which should return a string representing all of the messages which have been displayed to the user, in order.
  • The Register should also display the Total Price of all goods when the customer has finished scanning all items.

Discounts should appear separately from items such that 5 boxes of Cereal (reg. $3 but 4 for $10) would appear on the receipt like so:

Cereal $3.00
Cereal $3.00
Cereal $3.00
Cereal $3.00
Discount ($2.00)
Cereal $3.00

The exercise seemed to really engage the group this week, as typically we wrap up around 8pm but this time folks didn’t start leaving until 8:45pm or so.  Several pairs got most or all of the functionality written up, though I know at least in my case the resulting code was pretty rough.  I’m hoping to work through the problem a few times more so I can come up with a solid solution that I’m happy with, especially since I expect that this kata or a slight variation of it will be part of the CodeMash PreCompiler I’m co-hosting with Brendan next month.

Afterward, about 10 of us headed over to Kepner’s Tavern, which is a short walk from Henning Software’s offices in downtown Hudson.  Thanks again to Henning Software and NimblePros for hosting and sponsoring this month’s event, and we’ll see you next month for our January 20th meeting.  Happy Holidays!