[Chicago-talk] Containable examples
Pete Krawczyk
mongers at bsod.net
Thu May 24 08:46:52 PDT 2007
What is an example of a small, easily explained and containable project?
This morning, I came in early to work to give a presentation on
test-driven development to some people who weren't American. The project
we developed was a Perl module that keeps track of a game of bowling and
reports the score at the end.
This is a great, small, containable project, I thought.
The problem lies when you're crossing cultural, language and physical
borders. Bowling might be something almost everyone here has done, but in
other parts of the world, they can have different rules, if they bowl at
all. Part of my presentation was thus spent explaining all the rules of
American Tenpin bowling, so that we could all work off the same ruleset.
Believe it or not, bowling isn't the easiest sport to explain over a
phone.
After we were done, I talked to a person who orignally worked with the
team I was training. He told me while they had bowled at one point, it
wasn't something really familiar to them. If I could have had a module
based on cricket, or soccer, or something else, we might have been able to
avoid a lot of time spent explaining backstory before getting into the
actual examples.
This made me further think that some examples like this would be helpful
for people looking to write tutorials at PM meetings and conferences.
Assuming the following:
* No knowledge of program domain (e.g., non-bowlers) at start
* All rules and back-knowledge must be quickly explainable
* Project must do demonstrable work within a very short time
* Project should be able to scale to complex examples
what are some examples of projects that could be used for examples?
To get started, I'll give an example of what I'm looking for: Write a
module which, given two poker hands, reports which is higher (a la cmp).
All the domain knowledge you need is what a deck of cards is, the
different types of hands, the relative rank of hands, and the rules for
breaking ties.
Ideas for things that aren't games would be greatly appreciated, too.
-Pete K
--
Pete Krawczyk
Chicago Perl Mongers
mongers at bsod dot net
More information about the Chicago-talk
mailing list