<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Software Craftsmanship – Katas</title>
	<atom:link href="http://katas.softwarecraftsmanship.org/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://katas.softwarecraftsmanship.org</link>
	<description></description>
	<lastBuildDate>Tue, 06 Jul 2010 18:00:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Codebreaker in C# by Antonio Lucca</title>
		<link>http://katas.softwarecraftsmanship.org/?p=168</link>
		<comments>http://katas.softwarecraftsmanship.org/?p=168#comments</comments>
		<pubDate>Tue, 06 Jul 2010 18:00:01 +0000</pubDate>
		<dc:creator>Corey Haines</dc:creator>
				<category><![CDATA[Katas]]></category>
		<category><![CDATA[Software Craftsmanship]]></category>

		<guid isPermaLink="false">http://katas.softwarecraftsmanship.org/?p=168</guid>
		<description><![CDATA[After a long break, we have a fantastic katacast to present to you. Antonio Lucca contacted me with a new, C# version of the codebreaker kata. I started watching it and was blown away. Is that C#? In Vim? With autotest-like functionality? Super sweet! Without more rambling from me, here&#8217;s a bit about Antonio:
Antonio Lucca [...]]]></description>
			<content:encoded><![CDATA[<p>After a long break, we have a fantastic katacast to present to you. Antonio Lucca contacted me with a new, C# version of the codebreaker kata. I started watching it and was blown away. Is that C#? In Vim? With autotest-like functionality? Super sweet! Without more rambling from me, here&#8217;s a bit about Antonio:</p>
<blockquote><p>Antonio Lucca is a software journeyman, thinker and learner, and Scrum Master. He lives in Milano, Italy, at the moment. He is interested in principles and practices that helps making software development sustainable, efficient and fun.</p></blockquote>
<p>Here&#8217;s what he has to say about doing the kata:</p>
<blockquote><p>The first test cases are the non positional matches, then by some refactoring  everything comes up to a linq expression.<br />
The next test is related to a more intriguing case: Avoid counting twice a color that has already a match (the “mm” expected as result for a “yyxb” guess against a “rgby” secret, where the actual result is “mmm”, counting &#8216;y&#8217; twice).<br />
I commented that test for a while, and then did some refactoring until the base code was ready to implement just the logic needed to let that test pass.<br />
After that I implemented the positional match as a special case of the non-positional match, and then put them together in the Mark method.<br />
The tools that I used are autobuild (from google code), nunit growl addin, and&#8230; gvim.
</p></blockquote>
<p>One of the awesome things is the toolset he is using. You should watch it first, then come read how he did it. Here&#8217;s a write-up of this:</p>
<blockquote><p>I have a visual studio solution, but should not be not strictly required, however I didn&#8217;t try without having the visual studio solution. (I mean a build file in .sln format, suitable for the dot.net sdk msbuild command line tool).<br />
If you have only the dot.net sdk could work as well, as long as you can modify the autobuil.build nant file, that should be straghforward. however I havent tried yet. the free c# express edition to create solution file may works as well.<br />
Another possibility is avoid reference to the solution and modify the autobuild.build nant file to simply compile the sources via csc compiler.</p>
<p>However this is my configuration:<br />
1- you have a visual studio format solution folder of a project that referenced the nunit assembly (nunit.framework.dll)<br />
2- you have installed the autobuild from http://code.google.com/p/autobuildtool<br />
3- you have nunit version 2.5.5, and nunit growl notification addin, and growl as well<br />
4- you have a output named output (or whatever) where you copy &#8220;stuffs&#8221; as described in http://timross.wordpress.com/2009/08/04/continuous-testing-in-net/<br />
5- you modify there the autobuild.build file in the output directory to let it reference the solution file of your project (or call the plain source files compilation via &#8220;csc&#8221;. As I told, I didn&#8217;t try)<br />
6- on that file you change the &#8220;run-unit-tests&#8221; target so that it will call the external command line nunit-console that takes as argument the assembly generated by the build, (usually in bin\debug) redirecting the output on a file. Avoid using the nant2 task because it didn&#8217;t work (to me).<br />
7- open two different windows command prompt (cmd). One where you can launch autobuild.cmd, another one simply to show the nunit-console output redirected to the compiled file (dll assembly or .exe). you need to show the file via  tail -f. So a tail tool should be available as well, for example having cygwin installed.<br />
8- should be ready. Be sure that growl is running. Create a single failing test and if you launch the (included in autobuild) nant to autobuild.build file it will build the project and execute the tests, and the nunit notification should &#8220;growl&#8221;. Sometimes modification of the solution file (.sln) can be required, because, for instance the build does not see the output folder for the compiled.<br />
If the point 8 is ok, then launching autobuild.cmd should be able to do everything in background and so any change in any source file of the project will make the solution be rebuilded and test executed and notified in growl and in the output file (accessed via &#8220;tail -f&#8221;).
</p></blockquote>
<p>If you&#8217;d like to contact Antonio, here&#8217;s some info:<br />
Hompage: <a href="http://tonyxzt.blogspot.com/">http://tonyxzt.blogspot.com/</a><br />
Twitter: <a href="http://twitter.com/tonyxzt">tonyxzt</a></p>
<p>Enjoy!</p>
<p><object width="400" height="225"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=13072671&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=13072671&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="225"></embed></object>
<p><a href="http://vimeo.com/13072671">CodeBreaker marking guess revised</a> from <a href="http://vimeo.com/user2906925">tonyx</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://katas.softwarecraftsmanship.org/?feed=rss2&amp;p=168</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Michał Kwiatkowski &#8211; Sum of Even Fibonacci Numbers</title>
		<link>http://katas.softwarecraftsmanship.org/?p=161</link>
		<comments>http://katas.softwarecraftsmanship.org/?p=161#comments</comments>
		<pubDate>Fri, 05 Mar 2010 05:32:56 +0000</pubDate>
		<dc:creator>Corey Haines</dc:creator>
				<category><![CDATA[Katas]]></category>
		<category><![CDATA[Software Craftsmanship]]></category>

		<guid isPermaLink="false">http://katas.softwarecraftsmanship.org/?p=161</guid>
		<description><![CDATA[After a short break, we are back with an interesting kata in Clojure. Michał Kwiatkowski has tackled a project euler problem, finding the sum of the even Fibonacci numbers less than 4 million. Fun, indeed. Included in this katacast are 3 different solutions.
Michał Kwiatkowski is a software developer from Gdańsk, Poland. He builds RoR applications and [...]]]></description>
			<content:encoded><![CDATA[<p>After a short break, we are back with an interesting kata in Clojure. Michał Kwiatkowski has tackled a project euler problem, finding the sum of the even Fibonacci numbers less than 4 million. Fun, indeed. Included in this katacast are 3 different solutions.</p>
<blockquote><p>Michał Kwiatkowski is a software developer from Gdańsk, Poland. He builds RoR applications and in his spare time works on open source projects like Pythoscope (<a style="color: #147dba;" href="http://pythoscope.org/" target="_blank">http://pythoscope.org</a>). His interests include programming languages, artificial intelligence and automated testing.</p></blockquote>
<p>Here&#8217;s what he says about this katacast:</p>
<blockquote><p>I started doing kata after watching Micah Martin&#8217;s lecture, about 3 weeks ago. I wanted to start simple, so I&#8217;ve chosen a very basic problem from Project Euler: finding a sum of even Fibonacci numbers lower than 4 million. Each day, I tried a new technique or programming language. I studied solutions of others. Finally, I&#8217;ve settled on a set of three solutions, which are recorded in this video.</p></blockquote>
<blockquote><p>Main theme of this kata is different techniques for iteration which may be used in Clojure. First is a functional-style iteration using built-in &#8220;loop,&#8221; a second is a solution in a little DSL of sorts, via the &#8220;iter&#8221; library and third solution is based on lazy streams, inspired by Haskell.</p></blockquote>
<blockquote><p>Interesting thing about this kata was that even after solving the problem multiple times I could still make stupid mistakes from time to time, and writing a solution would take me 20 minutes instead of a minute. This shows how it&#8217;s important to practice basics of our craft *every single day*. There&#8217;s also a great value in approaching a problem from different perspectives. I&#8217;ve learned a great deal about the problem itself as well as about the tools I used to solve it. It&#8217;s a great way to asses strong and weak points of programming languages.</p></blockquote>
<p>Even though it includes 3 solutions, this katacast is nice and short. I enjoyed watching it a lot.</p>
<p>If you&#8217;d like to contact Michał, you can below:</p>
<p>Homepage: <a style="color: #147dba;" href="http://joker.linuxstuff.pl/" target="_blank">http://joker.linuxstuff.pl</a><br />
Tumblr blog: <a style="color: #147dba;" href="http://time-loop.tumblr.com/" target="_blank">http://time-loop.tumblr.com</a><br />
Twitter: <a href="http://www.twitter.com/infrared">infrared</a><br />
Enjoy:<br />
<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/f9tSuHje5vU&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/f9tSuHje5vU&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://katas.softwarecraftsmanship.org/?feed=rss2&amp;p=161</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>String Calculator &#8211; Clojure</title>
		<link>http://katas.softwarecraftsmanship.org/?p=154</link>
		<comments>http://katas.softwarecraftsmanship.org/?p=154#comments</comments>
		<pubDate>Thu, 11 Feb 2010 19:30:17 +0000</pubDate>
		<dc:creator>Corey Haines</dc:creator>
				<category><![CDATA[Katas]]></category>

		<guid isPermaLink="false">http://katas.softwarecraftsmanship.org/?p=154</guid>
		<description><![CDATA[Okay, okay, I know that I said we weren&#8217;t going to have another string calculator kata, but this one is in Clojure, and I wanted to get it up on the site. It is fun to watch, especially if you compare it to the Scheme one. Tom Crayford has been working on it for a [...]]]></description>
			<content:encoded><![CDATA[<p>Okay, okay, I know that I said we weren&#8217;t going to have another string calculator kata, but this one is in Clojure, and I wanted to get it up on the site. It is fun to watch, especially if you compare it to the Scheme one. Tom Crayford has been working on it for a few weeks, so I&#8217;m very excited to put it up.</p>
<blockquote><p>Tom Crayford is a student living in Sheffield, UK. His interests are lisp, dynamic languages and tinkering with emacs (and vim sometimes as well).</p></blockquote>
<p>And, here is what he has to say about the kata:</p>
<blockquote><p>I&#8217;ve been doing this kata as a morning exercise for the past two weeks. Regular practice is something I think many software developers are missing. This was my first real experience with proper TDD, and it has since found its way into every piece of programming I&#8217;ve done.</p></blockquote>
<blockquote><p>I&#8217;ve really enjoyed recording this kata, and have learned a lot. The best payoff has to be learning about TDD, and noticing the small improvements one can do was definitely very satisfying.</p></blockquote>
<blockquote><p>Although you might not be able to see it without HD, test failures are highlighted with red underlines in the test code (and errors with orange)</p></blockquote>
<p>I&#8217;m looking forward to putting up some more in the following weeks, as I know that we&#8217;ve been slacking a bit over the past month, or so. Don&#8217;t worry!</p>
<p>If you want to contact Tom, here&#8217;s some info:</p>
<p>Twitter: <a title="Tom Crayford on Twitter" href="http://twitter.com/t_crayford">t_crayford</a><br />
Blog: <a style="color: #147dba;" href="http://www.tcrayford.net" target="_blank">www.tcrayford.net</a></p>
<p>So, enjoy! As usual, if you have any constructive feedback, please leave a comment. If you&#8217;d be interested in doing a katacast, please let me know.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="250" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=9350864&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="400" height="250" src="http://vimeo.com/moogaloop.swf?clip_id=9350864&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><a href="http://vimeo.com/9350864">String Calculator Kata</a> from <a href="http://vimeo.com/user2764669">Tom Crayford</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://katas.softwarecraftsmanship.org/?feed=rss2&amp;p=154</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>String Calculator &#8211; Groovy</title>
		<link>http://katas.softwarecraftsmanship.org/?p=145</link>
		<comments>http://katas.softwarecraftsmanship.org/?p=145#comments</comments>
		<pubDate>Mon, 01 Feb 2010 22:19:44 +0000</pubDate>
		<dc:creator>Corey Haines</dc:creator>
				<category><![CDATA[Katas]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://katas.softwarecraftsmanship.org/?p=145</guid>
		<description><![CDATA[After being away for a couple weeks due to conferences and sickness, we present another entry in our “Same Kata, Different Languages” series: the String Calculator in Groovy by Itay Maman. This will most likely be the last of the String Calculator katas for a while, as we’ve been doing them for a long time [...]]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">After being away for a couple weeks due to conferences and sickness, we present another entry in our “Same Kata, Different Languages” series: the String Calculator in Groovy by Itay Maman. This will most likely be the last of the String Calculator katas for a while, as we’ve been doing them for a long time now; time for something different next week.</div>
<p>After being away for a couple weeks due to conferences and sickness, we present another entry in our “Same Kata, Different Languages” series: the String Calculator in Groovy by Itay Maman. This will most likely be the last of the String Calculator katas for a while, as we’ve been doing them for a long time now; time for something different next week.</p>
<div>
<blockquote>
<div>Itay Maman is a hopeless programmer living in Haifa (Israel). His doing a Ph.D. was just an excuse for writing cool software and for being able to read and hack cool code that others have written (Compilers and such).</div>
</blockquote>
</div>
<div>
<div></div>
<div>Groovy is an interesting language, since it looks so remarkable similar to Java, but definitely has less of the syntax. Here’s Itay’s description of doing the kata:</div>
<div></div>
</div>
<div>
<blockquote>
<div>I repeatedly practiced this Kata over the last few weeks. I eventually got to the point where I felt I’m doing it on “Auto pilot”. The Kata that I recorded was a bit different – I decided to take steps that are slightly than my usual, which made the whole thing interesting as I had to improvise here and there.</div>
</blockquote>
</div>
<div>
<blockquote>
<div>The nice thing about this Kata is its diversity. In “TDD By Example” Kent Beck lists three basic “moves”: (1) Fake it till you make it; (2) Triangulation; and (3) Obvious implementation. All three moves can be found here.</div>
</blockquote>
</div>
<div>
<blockquote>
<div>“Fake it” is my default. This quickly gets me to Green thereby providing the opportunity to refactor even before the implementation is complete. I like to think about it as a preemptive refactoring. You can see it in the last test. At 10:10 I inject a fake implementation. Then I do a preemptive refactoring: I introduce the “negs” variable which is the vehicle on which the real implementation is built.</div>
</blockquote>
</div>
<div>
<blockquote>
<div>Triangulation. 4:57 minutes into the Kata I am in a position where I reworked a “Fake it” implementation into a more general form, but I am not done. There is still a hard coded assignment: “delimiter = ‘;’”. At that point I felt that I covered enough grounds in the application code so I go back to the unit test and introduce a fresh test that fails (5:07). This leaves me with no option but to generalize the assignment into “delimiter = s.charAt(2).toString()”</div>
</blockquote>
</div>
<div>
<blockquote>
<div>Obvious implementation. There are three tests where the solution is just a few keystrokes away so I directly code it in. For example, when the shouldAllowNewlines() tests yields Red (3:38) I move to the application code, add a “|\\n” to the regular expression and get back to Green in 6 seconds.</div>
</blockquote>
</div>
<div>
<div></div>
<div>I like his description of some different techniques with TDD. I really enjoyed this katacast, as it is a pretty nice, fluid example of what you can do when you’ve practiced.</div>
</div>
<div>
<div></div>
<div>If you’d like to contact Itay:</div>
</div>
<div>
<div></div>
<div>Twitter: <a title="Itay on Twitter" href="http://www.twitter.com/pembleton">http://www.twitter.com/pembleton</a></div>
<div>Blog: <a title="Itay's Blog" href="http://javadots.blogspot.com">http://javadots.blogspot.com</a></div>
</div>
<div>
<div></div>
<div>As always, feel free to comment. Constructive comments are always welcome! If you are inspired to do your own kata and would like to prepare something for katacasts, definitely contact me.</div>
</div>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="225" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=9028476&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="400" height="225" src="http://vimeo.com/moogaloop.swf?clip_id=9028476&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><a href="http://vimeo.com/9028476">StringCalculator Groovy</a> from <a href="http://vimeo.com/user2965504">Itay Maman</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://katas.softwarecraftsmanship.org/?feed=rss2&amp;p=145</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Prime Factors Kata (Annotated)</title>
		<link>http://katas.softwarecraftsmanship.org/?p=139</link>
		<comments>http://katas.softwarecraftsmanship.org/?p=139#comments</comments>
		<pubDate>Thu, 07 Jan 2010 21:31:37 +0000</pubDate>
		<dc:creator>unclebob</dc:creator>
				<category><![CDATA[Katas]]></category>

		<guid isPermaLink="false">http://katas.softwarecraftsmanship.org/?p=139</guid>
		<description><![CDATA[Uncle Bob walks and talks his way through the Prime Factors Kata.
No music, but lots of commentary.

]]></description>
			<content:encoded><![CDATA[<p>Uncle Bob walks and talks his way through the Prime Factors Kata.</p>
<p>No music, but lots of commentary.</p>
<p><object id="viddler_unclebobmartin_7" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="437" height="370" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /><param name="src" value="http://www.viddler.com/player/17023668/" /><param name="name" value="viddler_unclebobmartin_7" /><param name="wmode" value="transparent" /><param name="allowfullscreen" value="true" /><embed id="viddler_unclebobmartin_7" type="application/x-shockwave-flash" width="437" height="370" src="http://www.viddler.com/player/17023668/" wmode="transparent" name="viddler_unclebobmartin_7" allowfullscreen="true" allowscriptaccess="always"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://katas.softwarecraftsmanship.org/?feed=rss2&amp;p=139</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>String Calculator &#8211; Python</title>
		<link>http://katas.softwarecraftsmanship.org/?p=128</link>
		<comments>http://katas.softwarecraftsmanship.org/?p=128#comments</comments>
		<pubDate>Wed, 06 Jan 2010 16:33:22 +0000</pubDate>
		<dc:creator>Corey Haines</dc:creator>
				<category><![CDATA[Katas]]></category>
		<category><![CDATA[Software Craftsmanship]]></category>

		<guid isPermaLink="false">http://katas.softwarecraftsmanship.org/?p=128</guid>
		<description><![CDATA[Continuing our series of &#8216;Same Kata, Different Languages,&#8217; we have a very special performance in Python by Gary Bernhardt:
Gary Bernhardt is an independent software contractor in Seattle specializing in the dynamic languages Python and Ruby. A brutal minimalist, he is bent on the destruction of all existing software except Emacs and Vim, the two One True Editors.
Gary&#8217;s a [...]]]></description>
			<content:encoded><![CDATA[<p>Continuing our series of &#8216;<a href="http://katas.softwarecraftsmanship.org/?p=92">Same Kata, Different Languages</a>,&#8217; we have a very special performance in Python by <a title="Gary Bernhardt on Twitter" href="http://www.twitter.com/garybernhardt">Gary Bernhardt</a>:</p>
<blockquote><p>Gary Bernhardt is an independent software contractor in Seattle specializing in the dynamic languages Python and Ruby. A brutal minimalist, he is bent on the destruction of all existing software except Emacs and Vim, the two One True Editors.</p></blockquote>
<p>Gary&#8217;s a fantastic developer with some amazing thoughts on software development. Here&#8217;s what he has to say about doing this kata:</p>
<blockquote><p>I&#8217;ve made dozens of runs through this kata, but I chose this one to post even though it has two accidental red bars. They&#8217;re nice red bars, though, because they show you just how fast test feedback can be. At one point, I run the tests and they fail unexpectedly. I see the bug, fix it, and get a green bar about two seconds after I fired off the original failing test run. That&#8217;s run-fail-analyze-fix-run-pass in two seconds. I think that we should strive for this fluidity in all of our software development and I love doing what I can to help others achieve it.<br />
There&#8217;s one section of the kata that I&#8217;d like to highlight. Around 3:30, when I begin to make the code reject negative numbers, I come to a point where it says &#8220;if there&#8217;s a minus sign at all, throw an exception.&#8221; Now I&#8217;m stuck – I can&#8217;t make that check more specific by talking about negative rejection. Instead, I write a test on the other side of the problem – I check for the case when the minus sign is actually a delimiter. The test fails, but the easiest way to fix it is a refactor from the code&#8217;s previous state. So, I comment the failing test out, do the refactor, uncomment the test, and now it passes. This is something that I stumbled over while learning TDD – I&#8217;d try to plow ahead and fix the failing test case directly, which can be a slow, frustrating process.</p></blockquote>
<p>Knowing Gary, when he says he did this dozens of time, he isn&#8217;t lying. Gary breaks from the norm of using classical music, but I think he&#8217;s chosen a great soundtrack that goes great with his style.</p>
<p>If you&#8217;d like to contact Gary:</p>
<p>blog: http://blog.extracheese.org/</p>
<p>twitter: http://www.twitter.com/garybernhardt</p>
<p>Feel free to comment. If you are inspired to do your own kata, please let me know. Watch and enjoy,  you are about to see an amazing performance.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="225" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=8569257&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="400" height="225" src="http://vimeo.com/moogaloop.swf?clip_id=8569257&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><a href="http://vimeo.com/8569257">String Calculator Kata In Python</a> from <a href="http://vimeo.com/user1043515">Gary Bernhardt</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://katas.softwarecraftsmanship.org/?feed=rss2&amp;p=128</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>String Calculator &#8211; Scheme</title>
		<link>http://katas.softwarecraftsmanship.org/?p=110</link>
		<comments>http://katas.softwarecraftsmanship.org/?p=110#comments</comments>
		<pubDate>Wed, 30 Dec 2009 08:00:03 +0000</pubDate>
		<dc:creator>Enrique Comba Riepenhausen</dc:creator>
				<category><![CDATA[Katas]]></category>
		<category><![CDATA[Software Craftsmanship]]></category>

		<guid isPermaLink="false">http://katas.softwarecraftsmanship.org/?p=110</guid>
		<description><![CDATA[Next in the series &#8217;same Kata, different language&#8217; I wanted to post my very own Kata in Scheme.
Currently I am learning Scheme. Due to my lack of knowledge in Scheme I could not write the tests (nor code) for the negative numbers part of the string calculator. I would have loved to get there, but [...]]]></description>
			<content:encoded><![CDATA[<p>Next in the series &#8217;same Kata, different language&#8217; I wanted to post my very own Kata in <a href="http://groups.csail.mit.edu/mac/projects/scheme/">Scheme</a>.</p>
<p>Currently I am learning <a href="http://groups.csail.mit.edu/mac/projects/scheme/">Scheme</a>. Due to my lack of knowledge in <a href="http://groups.csail.mit.edu/mac/projects/scheme/">Scheme</a> I could not write the tests (nor code) for the negative numbers part of the string calculator. I would have loved to get there, but I was reading about exception handling in Scheme and could not get my head around it in a short time to make this Kata work.</p>
<p>I might post in the future a polished String Calculator Kata in Scheme adding this elements.</p>
<p>For now, I hope you like this Kata as much as I did recording it. Special thanks as always goes to <a href="http://www.techsmith.com/camtasia.asp">Camtasia</a>, without them I would not have recorded the Kata so easily.</p>
<p>Enjoy! And, as usual, feel free to comment. If you are inspired to do your own kata, please let me know; I’d love to work with you on it.</p>
<p><object width="480" height="300"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=8397819&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=8397819&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="480" height="300"></embed></object></p>
<p><a href="http://vimeo.com/8397819">KataCast: StringCalculator in Scheme</a> from <a href="http://vimeo.com/ecomba">Enrique Comba Riepenhausen</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p><strong>Update!</strong></p>
<p>I have added a git repository with the skeleton of the project in scheme in case you want to fork/clone it and try yourself <a href="http://github.com/ecomba/String-Calculator">http://github.com/ecomba/String-Calculator</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://katas.softwarecraftsmanship.org/?feed=rss2&amp;p=110</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>My Response to Roy Osherove&#8217;s Feedback on my String Calculator Kata</title>
		<link>http://katas.softwarecraftsmanship.org/?p=114</link>
		<comments>http://katas.softwarecraftsmanship.org/?p=114#comments</comments>
		<pubDate>Sun, 27 Dec 2009 15:03:15 +0000</pubDate>
		<dc:creator>Corey Haines</dc:creator>
				<category><![CDATA[Feedback]]></category>

		<guid isPermaLink="false">http://katas.softwarecraftsmanship.org/?p=114</guid>
		<description><![CDATA[Since the String Calculator kata was posed by Roy Osherove, I asked him to take a look at my solution and give me feedback. He was kind enough to write an insightful blog post with some comments. Since he took the time to write them, I thought it fair to weigh in with my responses.
Roy:
Partial [...]]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Since the String Calculator kata was posed by Roy Osherove, I asked him to take a look at my solution and give me feedback. He was kind enough to write an insightful blog post with some comments. Since he took the time to write them, I thought it fair to weigh in with my responses.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Roy:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Partial Test: at some point, Corey seems to be writing the tests incrementally as well, in that he writes an empty test that passes, and then fills in the test itself to see it fail (which is usually where I start). I wasn’t sure why he’d do that, but the reasoning could be that he wants to make sure the environment works for the test. since he does it all in Ruby, which is a more forgiving environment for typing errors, this might be it.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Always passing test: very early on, in the second test actually, Corey creates a test that asserts that sending “0” returns “0” – which passes and never fails. That is because by default empty strings as input return zero. I do it a bit differently – i try to start with a failing test that drives more functionality, and if i can find a way to make a test for “0” fail as well to being, i will do it (so that i can ‘test the test’ in TDD style).</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Me:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">This is a great point. The strict TDD cycle is red-green-refactor. I like his point of using a &#8220;1&#8243; to watch it fail, then adds the #to_i call to make that pass.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Why did I put a &#8220;0&#8243; that was automatically green? Perhaps, in my mind, that was a test, as opposed to a design-pressure. I generally say that I TDD my way to the design through writing examples, then write tests after I have the code to catch edge cases, etc. During the process of writing the code, this isn&#8217;t always immediately obvious.  However, Roy&#8217;s point raises the question of &#8220;was the &#8216;0&#8242; case even a necessary test.&#8221; My answer? Probably not. <img src='http://katas.softwarecraftsmanship.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">One of the things that I like to bring up when facilitating Code Retreats is Braithwaite&#8217;s &#8220;TDD as if you meant it&#8221; exercise. This involves only writing the simplest example and the simplest code to force out the abstractions and design. This involves thinking about every example and its place in the design process. I clearly did not do this when I wrote the &#8220;0&#8243; case.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Roy:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Magic inputs: Corey sends in various seemingly random, out of the air numbers as inputs to the tests starting from the third test onwards. For example, to a reader who sees a test that says “sending in 5 returns 5” that reader might ask themselves “why 5? why is 5 so special? should I also use 5 in my tests?”.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">A different way: To avoid such confusion i like to stick to the lowest common version of an input that still proves the application wrong. if sending in “1” produces the same result as sending in “5” then my all means i will send in “1”. If the input is 2 digits, I’d send in “10”, “100” and so on. If the input still does not make sense I would put it in as a variable named “SINGLE DIGIT NUMBER” to explain to the reader what is so special or not so special about this value.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Me:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">This is a fantastic point from Roy. Watching through the performance, I can definitely see how this is strange. I&#8217;m not always a fan of using &#8220;1&#8243;, &#8220;10&#8243;, &#8220;100&#8243; as examples, since they feel much too similar in structure. However, passing &#8220;5&#8243; isn&#8217;t much better without an explanation. Perhaps a better case would be to change my example description to &#8220;handles single digit number,&#8221; rather than &#8220;returns 5 for 5.&#8221; I like the idea of changing the variable name, as well, for further explanation.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Roy:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">The simplest Test:Corey wrote the tests for inputs with \newline characters without considering the most basic test for this kind: a simple string containing only a new line character (equivalent to an empty string). I agree that not everyone would pick up on this as an idea, since you might feel this is an invalid input into the system. nevertheless, when I teach TDD this is the way i teach the kata. It feels like a more natural incremental evolution of the code and tests, and a good way to send the message that anything can be divided into small increments if you want to.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Me:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Wow! This is absolutely true. I was so far along in the implementation, definitely already in the flow, that I didn&#8217;t think to drop back to such a simple case. I&#8217;d like to claim that I felt &#8216;this is an invalid input into the system,&#8217; but I didn&#8217;t. <img src='http://katas.softwarecraftsmanship.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I just didn&#8217;t think about.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Roy&#8217;s point about this being a good way to send the message of dividing into ever-smaller increments is great. When I teach people, I often ask them the same question.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Roy:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Refactor to un-readability: At some point Corey refactors the code that handles delimiter characters into a single line of Ruby code. while it isa form of refactoring, i found that the code after refactoring was much less readable than it was before.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Me:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">This is a wonderful point. I laughed when I read it, because I had brought up the exact same point not too long ago while reviewing someone&#8217;s clojure code. Their response was &#8216;if you knew clojure better, it would not be cryptic.&#8217; I sometimes accept this as an answer, but only rarely. Within reason, I feel, truly well-written code can be understood with minimal fuss by an experienced developer, no matter what the language.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">However, the &#8216;if you knew x better, you would not think it unreadable&#8217; argument can be valid in some cases. Is this one of those cases? I thought I would take a look at the code and see what I think.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">self[0,2] == &#8216;//&#8217; ? delimiter = self[2,1] : &#8216;,&#8217;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">After not seeing this for a bit of time, my first impression is that the indexing is a bit domain-specific. In order to understand this line, you need to know that the first two characters equaling &#8216;//&#8217; imply that the next character is the custom delimiter. If I were helping someone improve this code, I would ask whether it would be better with something like</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">has_custom_delimiter? ? customer_delimiter : DEFAULT_DELIMITER</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">In fact, after reviewing this code, I realize that the clause (delimiter = ) is completely unnecessary and left over from a previous step. Naughty me! This goes to show that mercilessly refactoring your code can sometimes highlight things that you might miss by visually looking at it.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">So, to answer the question posed above: no, this isn&#8217;t one of those cases. This was simply a case of not cleaning up enough. <img src='http://katas.softwarecraftsmanship.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Thanks, Roy, for pointing it out.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">I want to address the idea of feedback. As I wrote in &#8216;What are Katacasts,&#8217; a major reason for performing katas is to elicit feedback from your peers. None of us are perfect, and, in fact, most of us continue to seek out insight into coding through sharing our ideas with others. By receiving specific and pointed feedback, such as what Roy gave, it helps us improve both by learning new ideas and being reminded of fundamentals that we might have forgotten. I want to thank Roy for taking the time to provide this.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">In fact, I would challenge all of us, myself included, to take the time to provide feedback to each other in the form that Roy did for me. The Software Craftsmanship Manifesto states</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Not only individuals and interactions, but a community of professionals.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">For me, being in a community of professionals means that we strive to help each other improve. Feedback on code kata performances, either here on katacasts, at a user group or someone&#8217;s personal blog, is an essential part of this.</div>
<p>Since the String Calculator kata was <a title="Roy Osherove's TDD Kata" href="http://osherove.com/tdd-kata-1/" target="_blank">posed by Roy Osherove</a>, I asked him to take a look at <a title="String Calculator in Ruby" href="http://katas.softwarecraftsmanship.org/?p=80" target="_self">my solution</a> and give me feedback. He was kind enough to write a <a title="Roy's comments on my string calculator kata" href="http://weblogs.asp.net/rosherove/archive/2009/12/23/comments-on-corey-haines-string-calculator-tdd-kata-implementation.aspx" target="_blank">blog post with some comments</a>. Since he took the time to write them, I thought it fair to weigh in with my responses.</p>
<blockquote><p>Partial Test: at some point, Corey seems to be writing the tests incrementally as well, in that he writes an empty test that passes, and then fills in the test itself to see it fail (which is usually where I start). I wasn’t sure why he’d do that, but the reasoning could be that he wants to make sure the environment works for the test. since he does it all in Ruby, which is a more forgiving environment for typing errors, this might be it.</p>
<p>Always passing test: very early on, in the second test actually, Corey creates a test that asserts that sending “0” returns “0” – which passes and never fails. That is because by default empty strings as input return zero. I do it a bit differently – i try to start with a failing test that drives more functionality, and if i can find a way to make a test for “0” fail as well to being, i will do it (so that i can ‘test the test’ in TDD style).</p></blockquote>
<p>This is a great point. The strict TDD cycle is red-green-refactor. I like his point of using a &#8220;1&#8243; to watch it fail, then add the #to_i call to make that pass.</p>
<p>Why did I put a &#8220;0&#8243; that was automatically green? Perhaps, in my mind, that was a test, as opposed to a design-pressure. I generally say that I TDD my way to the design through writing examples, then write tests after I have the code to catch edge cases, etc. During the process of writing the code, this isn&#8217;t always immediately obvious.  However, Roy&#8217;s point raises the question of &#8220;was the &#8216;0&#8242; case even a necessary test.&#8221; My answer? Probably not. <img src='http://katas.softwarecraftsmanship.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>One of the things that I like to bring up when facilitating <a title="Code Retreats" href="http://coderetreat.ning.com/" target="_blank">Code Retreats</a> is Braithwaite&#8217;s &#8220;<a title="TDD as if you meant it" href="http://gojko.net/2009/02/27/thought-provoking-tdd-exercise-at-the-software-craftsmanship-conference/" target="_blank">TDD as if you meant it</a>&#8221; exercise. This involves only writing the simplest example and the simplest code to force out the abstractions and design. This involves thinking about every example and its place in the design process. I clearly did not do this when I wrote the &#8220;0&#8243; case.</p>
<blockquote><p>Magic inputs: Corey sends in various seemingly random, out of the air numbers as inputs to the tests starting from the third test onwards. For example, to a reader who sees a test that says “sending in 5 returns 5” that reader might ask themselves “why 5? why is 5 so special? should I also use 5 in my tests?”.</p>
<p>A different way: To avoid such confusion i like to stick to the lowest common version of an input that still proves the application wrong. if sending in “1” produces the same result as sending in “5” then my all means i will send in “1”. If the input is 2 digits, I’d send in “10”, “100” and so on. If the input still does not make sense I would put it in as a variable named “SINGLE DIGIT NUMBER” to explain to the reader what is so special or not so special about this value.</p></blockquote>
<p>This is a good point from Roy. Watching through the performance, I can definitely see how this is strange. I&#8217;m not a fan of using &#8220;1&#8243;, &#8220;10&#8243;, &#8220;100&#8243; as examples, since they feel too similar in structure. However, passing &#8220;5&#8243; isn&#8217;t much better without an explanation. Perhaps a better case would be to change my example description to &#8220;handles single digit number,&#8221; rather than &#8220;returns 5 for 5.&#8221; I like the idea of changing the variable name, as well, for further explanation.</p>
<blockquote><p>The simplest Test:Corey wrote the tests for inputs with \newline characters without considering the most basic test for this kind: a simple string containing only a new line character (equivalent to an empty string). I agree that not everyone would pick up on this as an idea, since you might feel this is an invalid input into the system. nevertheless, when I teach TDD this is the way i teach the kata. It feels like a more natural incremental evolution of the code and tests, and a good way to send the message that anything can be divided into small increments if you want to.</p></blockquote>
<p>Wow! Great catch. I was so far along in the implementation, definitely already in the flow, that I didn&#8217;t think to drop back to such a simple case. I&#8217;d like to claim that I felt &#8216;this is an invalid input into the system,&#8217; but I didn&#8217;t. <img src='http://katas.softwarecraftsmanship.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I just didn&#8217;t think about.</p>
<p>Roy&#8217;s point about this being a good way to send the message of dividing into ever-smaller increments is great. When I teach people, I often ask them the same question.</p>
<blockquote><p>Refactor to un-readability: At some point Corey refactors the code that handles delimiter characters into a single line of Ruby code. while it is a form of refactoring, i found that the code after refactoring was much less readable than it was before.</p></blockquote>
<p>This is a wonderful point. I laughed when I read it, because I had brought up the exact same point not too long ago while reviewing someone&#8217;s clojure code. Their response was &#8216;if you knew clojure better, it would not be cryptic.&#8217; I sometimes accept this as an answer, but only rarely. Within reason, I feel, truly well-written code can be understood with minimal fuss by an experienced developer, no matter what the language.</p>
<p>(<em>update:</em> <a title="Tracy Harms on Twitter" href="http://www.twitter.com/kaleidic" target="_blank">Tracy Harms</a> has called me on the above statement that some languages are not necessary readable by an experience developer with no prior knowledge. So, I gracefully concede that APL and J are decidedly NOT readable. Of course, after seeing bits of both, I will question whether those languages are readable by ANY developer. just kidding. I still hold that most mainstream, not codified math-based, languages should be readable. )</p>
<p>However, the &#8216;if you knew x better, you would not think it unreadable&#8217; argument can be valid in some cases. Is this one of those cases? I thought I would take a look at the code and see what I think.</p>
<pre style="padding-left: 30px;">self[0,2] == '//' ? delimiter = self[2,1] : ','</pre>
<p>After being away from this code, my first impression is that the indexing is a bit domain-specific, but not domain-specifying. In order to understand this line, you need to know that the first two characters equaling &#8216;//&#8217; imply that the next character is the custom delimiter. If I were helping someone improve this code, I would ask whether it would be better with something like</p>
<pre style="padding-left: 30px;">has_custom_delimiter? ? customer_delimiter : DEFAULT_DELIMITER</pre>
<p>In fact, after reviewing this code, I realize that the clause (delimiter = ) is completely unnecessary and left over from a previous step. Naughty me! This goes to show that mercilessly refactoring your code can sometimes highlight things that you might miss by visually looking at it.</p>
<p>So, to answer the question posed above: no, this isn&#8217;t a case of &#8217;if you knew x better, you would not think it unreadable.&#8217; This was simply a case of not cleaning up enough. <img src='http://katas.softwarecraftsmanship.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Thanks, Roy, for pointing it out.</p>
<h3>On A Side Note</h3>
<p>I want to address the idea of feedback. As I wrote in &#8216;<a title="What are katacasts?" href="http://katas.softwarecraftsmanship.org/?page_id=2" target="_self">What are Katacasts</a>,&#8217; a major reason for performing katas is to elicit feedback from your peers. None of us are perfect, and, in fact, most of us continue to seek insight into coding through sharing our ideas with others. By receiving specific and pointed feedback, such as what Roy gave me, it helps us improve both by learning new ideas and being reminded of fundamentals that we might have forgotten. I want to thank Roy for taking the time to provide this.</p>
<p>In fact, I would challenge all of us, myself included, to take the time to provide feedback to each other in the form that Roy did for me. The <a title="Software Craftsmanship Manifesto" href="http://manifesto.softwarecraftsmanship.org/" target="_blank">Software Craftsmanship Manifesto</a> states</p>
<blockquote><p>Not only individuals and interactions, but a community of professionals.</p></blockquote>
<p>For me, being in a community of professionals means that we strive to help each other improve. Feedback on code kata performances, either here on katacasts, at a user group or someone&#8217;s personal blog, is an essential part of this.</p>
]]></content:encoded>
			<wfw:commentRss>http://katas.softwarecraftsmanship.org/?feed=rss2&amp;p=114</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>String Calculator &#8211; Scala</title>
		<link>http://katas.softwarecraftsmanship.org/?p=107</link>
		<comments>http://katas.softwarecraftsmanship.org/?p=107#comments</comments>
		<pubDate>Thu, 24 Dec 2009 22:17:15 +0000</pubDate>
		<dc:creator>Corey Haines</dc:creator>
				<category><![CDATA[Katas]]></category>

		<guid isPermaLink="false">http://katas.softwarecraftsmanship.org/?p=107</guid>
		<description><![CDATA[Continuing our series of &#8217;same kata, different languages,&#8217; Giordano Scalzo provides us with a great view of the kata in Scala. I&#8217;ve fooled around a little bit with Scala, but definitely felt like I was just writing java in a not-quite-different environment. Watching Giordano code was very refreshing.
Giordano Scalzo is a Software &#8220;jack of all [...]]]></description>
			<content:encoded><![CDATA[<p>Continuing our series of &#8217;same kata, different languages,&#8217; Giordano Scalzo provides us with a great view of the kata in Scala. I&#8217;ve fooled around a little bit with Scala, but definitely felt like I was just writing java in a not-quite-different environment. Watching Giordano code was very refreshing.</p>
<blockquote><p>Giordano Scalzo is a Software &#8220;jack of all trades, master of none&#8221; living in Milan (Italy). He does Software for fun since early &#8217;80s and he&#8217;s paid for it since 1997. Got interested in Agile stuff in 2000 and, since then, he tries to follow the principles in everything he do. In the last years moved toward the management part of the develompment, still embrancing all Agile values and spreading them between all people he works with.</p></blockquote>
<p>Here&#8217;s Giordano&#8217;s description:</p>
<blockquote><p>I admit it: do this kata has been an hard challenge; this is the longest Scala program I ever wrote and this is the first Kata I did with objectives: the first was to performe live at Milan Xpug meeting, and the second was to record it in a smooth way. Two different practices that gave me a lot feedback and self consciousness about the way I write code.<br />
Many thanks to <a style="color: #147dba;" href="http://www.gabrielelana.it/" target="_blank">Gabriele Lana</a> which arranged an exciting Kata evening at Milan Xpug and to <a style="color: #147dba;" href="http://www.coreyhaines.com/" target="_blank">Corey</a> which host me on <a style="color: #147dba;" href="http://www.katacasts.com/" target="_blank">http://www.katacasts.com</a>.<br />
I&#8217;d love to receive any kind of suggestions, about the solution I got and the process I used to reach it.<br />
I think Software Craftsmanship is the most exciting movement in Software Development since the times of Agile Manifesto, and the katas are a wonderful way to sharp our skills.<br />
Finally, I hope you&#8217;ll enjoy my performance.</p></blockquote>
<p>I definitely enjoyed it!</p>
<p>Enjoy! And, as usual, feel free to comment. If you are inspired to do your own kata, please let me know; I&#8217;d love to work with you on it.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="250" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=8326880&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="400" height="250" src="http://vimeo.com/moogaloop.swf?clip_id=8326880&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><a href="http://vimeo.com/8326880">KataCast: StringCalculator in Scala</a> from <a href="http://vimeo.com/user2802092">giordano scalzo</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://katas.softwarecraftsmanship.org/?feed=rss2&amp;p=107</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>String Calculator &#8211; Erlang</title>
		<link>http://katas.softwarecraftsmanship.org/?p=96</link>
		<comments>http://katas.softwarecraftsmanship.org/?p=96#comments</comments>
		<pubDate>Thu, 17 Dec 2009 13:10:24 +0000</pubDate>
		<dc:creator>Corey Haines</dc:creator>
				<category><![CDATA[Katas]]></category>

		<guid isPermaLink="false">http://katas.softwarecraftsmanship.org/?p=96</guid>
		<description><![CDATA[For our first in the series of &#8217;same kata, multiple languages,&#8217; we have a treat for everyone, Gabriele Lana is doing it in Erlang.
Gabriele Lana is a software journeyman living in Milan (Italy). Since 1998 he works as a developer and consultant. In 2000 he started using Agile practices in real time and embedded industries, proving their effectiveness [...]]]></description>
			<content:encoded><![CDATA[<p>For our first in the series of &#8217;same kata, multiple languages,&#8217; we have a treat for everyone, <a title="Gabriele Lana on Twitter" href="http://twitter.com/gabrielelana">Gabriele Lana</a> is doing it in Erlang.</p>
<blockquote><p>Gabriele Lana is a software journeyman living in Milan (Italy). Since 1998 he works as a developer and consultant. In 2000 he started using Agile practices in real time and embedded industries, proving their effectiveness in this domain. Since then he has always applied Agile values and principles to his work, doing coaching and mentoring to many teams in different fields (banking, medical, monitoring, &#8230;). He is currently developing products with Erlang, Ruby and Javascript.</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 18px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">blog: http://www.gabrielelana.it</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 18px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">twitter: http://twitter.com/gabrielelana</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 18px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">github: http://github.com/gabrielelana</div>
</blockquote>
<p>Here is Gabriele&#8217;s description of his kata.</p>
<blockquote><p>This is the String Calculator kata by Roy Osherove done in Erlang (R13B03), the standard EUnit application for the test execution and vim as text editor (without fancy plugins, only surround.vim). I have performed a few code kata before in a few languages but this is the first one recorded. I have discovered a huge value in recording and watching your own performance, you can spot many little but important improvements (thank also to Corey for pushing me to complete the kata in less than 15 minutes, the initial version took me more than 30 minutes). The obsessive search for the perfect flow could be seen as nonsense, but it&#8217;s what you learn in the journey that matters. I would love to receive some feedback and I hope you enjoy my performance.</p></blockquote>
<p>I really enjoyed watching this one, as it has been a while since I looked at Erlang.</p>
<p>If you&#8217;d like to contact Gabriele:</p>
<p>blog: <a title="Gabriele Lana's Blog" href="http://www.gabrielelana.it">http://www.gabrielelana.it</a></p>
<p>twitter: <a title="Gabriele Lana on Twitter" href="http://twitter.com/gabrielelana">http://twitter.com/gabrielelana</a></p>
<p>github: <a title="Gabriele Lana on Github" href="http://github.com/gabrielelana">http://github.com/gabrielelana</a></p>
<p>Enjoy! And, as usual, feel free to comment. If you are inspired to do your own kata, please let me know.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="250" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=8206748&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="400" height="250" src="http://vimeo.com/moogaloop.swf?clip_id=8206748&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><a href="http://vimeo.com/8206748">String Calculator in Erlang</a> from <a href="http://vimeo.com/gabrielelana">Gabriele Lana</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p>Oh, and +1000 points to Gabriele for using the music for Monty Python&#8217;s Oliver Cromwell song. <img src='http://katas.softwarecraftsmanship.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://katas.softwarecraftsmanship.org/?feed=rss2&amp;p=96</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>
