<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>The Code Dump</title>
	
	<link>http://www.codelord.net</link>
	<description>A place a coder rants at...</description>
	<lastBuildDate>Fri, 27 Aug 2010 17:14:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/TheCodeDump" /><feedburner:info uri="thecodedump" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Logging with a Context: Users in Logback and Spring Security</title>
		<link>http://feedproxy.google.com/~r/TheCodeDump/~3/f98kxGe3YtU/</link>
		<comments>http://www.codelord.net/2010/08/27/logging-with-a-context-users-in-logback-and-spring-security/#comments</comments>
		<pubDate>Fri, 27 Aug 2010 17:14:17 +0000</pubDate>
		<dc:creator>abyx</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[techie]]></category>

		<guid isPermaLink="false">http://www.codelord.net/?p=214</guid>
		<description><![CDATA[During this hectic time of starting an amazing adventure we find that along many of the big and important challenges we have there is an endless stream of small technical problems that solving poorly means a lot of time will go to waste. One of these is proper logging in a way that will allow [...]]]></description>
			<content:encoded><![CDATA[<div>During this hectic time of starting an amazing adventure we find that along many of the big and important challenges we have there is an endless stream of small technical problems that solving poorly means a lot of time will go to waste.</div>
<div></div>
<div>One of these is proper logging in a way that will allow you see what your users are doing properly. Pretty quickly we came to the conclusion we want each log message to contain information about the user&#8217;s context, so we could easily understand what went wrong when a user tells us about it, and be able to track usage patterns.</div>
<div></div>
<div>The simplest thing we thought of was creating our own logger wrapper to insert our special values, but didn&#8217;t like the idea of having to write our own logging interface all over again. We&#8217;re using Logback and Spring Security, and after some googling and stackoverflowing I&#8217;ve found this solution:</div>
<div></div>
<div>We create simple Converters to insert the username and session ID to the logs, if present:</div>
<p><script src="http://gist.github.com/553724.js"> </script></p>
<p>To make logback know where to find these converters, we add this little guy:<br />
<script src="http://gist.github.com/553731.js"> </script></p>
<p>And now all that&#8217;s left are configuration changes. Make your pattern contain our cool new keys (&#8220;%user&#8221; and &#8220;%session&#8221;):<br />
<script src="http://gist.github.com/553738.js"> </script></p>
<p>And this last part is needed for the session context thingie to work (as I was instructed on <a href="http://stackoverflow.com/questions/3542026/retrieving-session-id-with-spring-security">Stack Overflow</a>). We need to add a certain listener to our web.xml:<br />
<script src="http://gist.github.com/553742.js"> </script></p>
<p>And that&#8217;s about it. Happy logging!</p>
<ul></ul>
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codelord.net%2F2010%2F08%2F27%2Flogging-with-a-context-users-in-logback-and-spring-security%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codelord.net%2F2010%2F08%2F27%2Flogging-with-a-context-users-in-logback-and-spring-security%2F&amp;source=avivby&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>

<p><a href="http://feedads.g.doubleclick.net/~a/MDP-zDSBKqPPB9Q6qgwvnBjVewg/0/da"><img src="http://feedads.g.doubleclick.net/~a/MDP-zDSBKqPPB9Q6qgwvnBjVewg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/MDP-zDSBKqPPB9Q6qgwvnBjVewg/1/da"><img src="http://feedads.g.doubleclick.net/~a/MDP-zDSBKqPPB9Q6qgwvnBjVewg/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/TheCodeDump/~4/f98kxGe3YtU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codelord.net/2010/08/27/logging-with-a-context-users-in-logback-and-spring-security/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.codelord.net/2010/08/27/logging-with-a-context-users-in-logback-and-spring-security/</feedburner:origLink></item>
		<item>
		<title>Unleashing Your Enthusiasm: Grunts Making a Change</title>
		<link>http://feedproxy.google.com/~r/TheCodeDump/~3/r7KP1GOYPi8/</link>
		<comments>http://www.codelord.net/2010/08/20/unleashing-your-enthusiasm-grunts-making-a-change/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 16:35:04 +0000</pubDate>
		<dc:creator>abyx</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[clean code]]></category>
		<category><![CDATA[software craftsmanship]]></category>
		<category><![CDATA[tdd]]></category>

		<guid isPermaLink="false">http://www.codelord.net/?p=207</guid>
		<description><![CDATA[I&#8217;ve been doing retrospection and navel-gazing lately, after deciding to join a new adventure and leaving an awesome job. I had the chance to work in XIV-IBM for just over a year, and it being my first real job I was thinking of how satisfied I am with my work there. As I&#8217;ve mentioned in [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been doing retrospection and navel-gazing lately, after deciding to join a <a href="http://crowdspot.com/">new adventure</a> and leaving an awesome job. I had the chance to work in XIV-IBM for just over a year, and it being my first real job I was thinking of how satisfied I am with my work there.</p>
<p>As I&#8217;ve mentioned in previous posts, it&#8217;s not easy taking the software craftsmanship road when joining a team with a large code base and practically zero tests. I joined in order to help introduce automated testing to the team&#8217;s development process, but making these changes is never easy.</p>
<p>I recently read an amazing book called <a href="http://www.amazon.com/gp/product/0596518382?ie=UTF8&amp;tag=thcodu02-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0596518382">Apprenticeship Patterns</a><img style="border: none !important; margin: 0px !important;" src="http://www.assoc-amazon.com/e/ir?t=thcodu02-20&amp;l=as2&amp;o=1&amp;a=0596518382" border="0" alt="" width="1" height="1" />, which collects the different patterns we share in our industry on our track to professionalism. Of those patterns, reading <a href="http://bit.ly/bSaaTF">&#8220;Unleash Your Enthusiasm&#8221;</a> suddenly made me understand more clearly what I&#8217;ve been doing that year.</p>
<p>When I just joined the team, I naturally tried to get the vibes of the team and &#8220;go with the flow&#8221;. The first small projects I did on my first few weeks to get my feet wet weren&#8217;t a craftsman&#8217;s best work, to say the least. I barely wrote any tests, and since Python doesn&#8217;t have decent refactoring tools, that made me refactor less. After a couple of weeks I was already getting angry with myself, and once I noticed thinking of changes to the code made me twitch it was clear something was wrong (after all we&#8217;re all for &#8220;embracing change&#8221;, aren&#8217;t we?).</p>
<p>I decided to return to the good path. Catching up on some best practices for unit testing in Python and adopting once more the Red-Green-Refactor cycle did the trick for me. I haven&#8217;t stopped TDDing since and didn&#8217;t look back. But here is where the story got more interesting.</p>
<p style="text-align: center;"><a href="http://www.codelord.net/wp-content/uploads/2010/08/crowdsurfing1.jpg"><img class="aligncenter size-medium wp-image-211" title="crowdsurfing" src="http://www.codelord.net/wp-content/uploads/2010/08/crowdsurfing1-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>Working on a project mainly by myself meant I had it easy in making sure the code base is tested the way I liked it. My manager thought, as a good manager does, that as long as the outcome is good he shouldn&#8217;t care if I do something no one else on the team does. This allowed me to have my fun, but still something was missing. I really found it hard seeing my teammates having troubles that could have been easily avoided with a good suite of tests. More than once I saw people in a debugging spiral or fighting a refactoring gone wrong.</p>
<p>Being the loud-mouth that I can be, I made sure to help people see how much fun I had writing code as code was meant to be written. Parading my Clean Code wristband, posting <a href="http://agilemanifesto.org/">certain</a> <a href="http://manifesto.softwarecraftsmanship.org/">manifestos</a> on the walls and sending the team links or snippets was a good start.</p>
<p>After a while, some people wanted to hear more. I gave a unit testing talk that pretty much got people hooked after I deleted random lines of code and showed them the tests captured it every time, and the knock out was Gary Bernhardt&#8217;s <a href="http://bit.ly/9QyUAj">awesome kata</a> that showed TDD won&#8217;t slow you down.</p>
<p>Seeing that team&#8217;s lack of testing slowly transforming to a suite of tests that kept getting closer and closer to the <a href="http://bit.ly/dgDfnr">FIRST principles</a> made me understand how a young developer can really unleash his enthusiasm to make real changes happen. No one has made the jump to TDD yet, but I think the whole team can be proud for adding hundreds of tests to their code base in less than a year. Remember, if you work with excellent people, sometimes <a href="http://www.codelord.net/2009/04/04/sometimes-all-it-takes-is-a-little-push/">all it takes is a little push</a> to get them on a better track.</p>
<p>This taught me yet again that being a craftsman is about sticking to your principles. Craftsmanship of Crap all the way.</p>
<p>You should subscribe to my <a href="http://feeds.feedburner.com/TheCodeDump">feed</a> and follow me on <a href="http://twitter.com/avivby">Twitter</a>.
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codelord.net%2F2010%2F08%2F20%2Funleashing-your-enthusiasm-grunts-making-a-change%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codelord.net%2F2010%2F08%2F20%2Funleashing-your-enthusiasm-grunts-making-a-change%2F&amp;source=avivby&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>

<p><a href="http://feedads.g.doubleclick.net/~a/4YvN0Y8IyMukWnCjm1jvx6acEkc/0/da"><img src="http://feedads.g.doubleclick.net/~a/4YvN0Y8IyMukWnCjm1jvx6acEkc/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/4YvN0Y8IyMukWnCjm1jvx6acEkc/1/da"><img src="http://feedads.g.doubleclick.net/~a/4YvN0Y8IyMukWnCjm1jvx6acEkc/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/TheCodeDump/~4/r7KP1GOYPi8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codelord.net/2010/08/20/unleashing-your-enthusiasm-grunts-making-a-change/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.codelord.net/2010/08/20/unleashing-your-enthusiasm-grunts-making-a-change/</feedburner:origLink></item>
		<item>
		<title>Book Review: Clean Code</title>
		<link>http://feedproxy.google.com/~r/TheCodeDump/~3/1OzWX4WyIz0/</link>
		<comments>http://www.codelord.net/2010/06/15/book-review-clean-code/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 17:45:19 +0000</pubDate>
		<dc:creator>abyx</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[software craftsmanship]]></category>

		<guid isPermaLink="false">http://www.codelord.net/?p=202</guid>
		<description><![CDATA[This is another post in my book reviews series. I finished reading Clean Code a few days ago and loved it. It makes me feel good, seeing my decision to wear the Clean Code wristband a few months ago was a smart one. After I finished it, I felt a bit weird writing a blog [...]]]></description>
			<content:encoded><![CDATA[<p>This is another post in my <a href="http://www.codelord.net/tag/books/">book reviews series</a>. I finished reading <a href="http://www.amazon.com/gp/product/0132350882?ie=UTF8&amp;tag=thcodu02-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0132350882">Clean Code</a><img style="border: none !important; margin: 0px !important;" src="http://www.assoc-amazon.com/e/ir?t=thcodu02-20&amp;l=as2&amp;o=1&amp;a=0132350882" border="0" alt="" width="1" height="1" /> a few days ago and loved it. It makes me feel good, seeing my decision to wear the Clean Code <a href="http://bit.ly/aPug4e">wristband</a> a few months ago was a smart one.</p>
<p>After I finished it, I felt a bit weird writing a blog post about it, because, just like the previous books I&#8217;ve blogged about, I found this book simply awesome. Then I thought about the fact it&#8217;s simply because I&#8217;m reading those books that show up enough in other contexts that I upped them in my reading queue enough to get on top.</p>
<p>The book is about practical, low level details of writing good code. There are chapters about comments, naming, functions, you name it. In a way, it reminds me of <a href="http://www.amazon.com/gp/product/0735619670?ie=UTF8&amp;tag=thcodu02-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0735619670">Code Complete</a><img style="border: none !important; margin: 0px !important;" src="http://www.assoc-amazon.com/e/ir?t=thcodu02-20&amp;l=as2&amp;o=1&amp;a=0735619670" border="0" alt="" width="1" height="1" />, other than the fact you can see it&#8217;s oriented for more practiced developers.</p>
<p>Like in his <a href="http://www.amazon.com/gp/product/0135974445?ie=UTF8&amp;tag=thcodu02-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0135974445">Agile Software Development</a><img style="border: none !important; margin: 0px !important;" src="http://www.assoc-amazon.com/e/ir?t=thcodu02-20&amp;l=as2&amp;o=1&amp;a=0135974445" border="0" alt="" width="1" height="1" /> book, Uncle Bob made sure to fill this one with code. Actually, this book has a lot more code. There are many examples of code still being worked on. It actually fills the gap I&#8217;ve felt in Agile Software Development of seeing the actual coding steps, test by test. The last chapter shows a really thorough (and actually quite mesmerizing) example of refactoring, with each change explained beforehand, including tests and alternatives considered.</p>
<p>In Agile Software Development, there were a few co-authored chapters. In Clean Code Uncle Bob took this a step further. Almost every chapter was written by a different author, each of very big caliber in the Agile and Software Craftsmanship world. This really resonated with me, because it&#8217;s kind of a &#8220;many in one&#8221; deal, and because I could actually hear a different tone in each chapter, and yet all were in harmony with the motive of clean code.</p>
<p>I think this is truly a masterpiece, and after reading, would recommend it to be read before Agile Software Development. Due to its greater technicality and the fact it&#8217;s quite new, it makes a really good read for developers, and it will have an effect on your coding a few pages in (pages! not even chapters).</p>
<p>The only thing that bothered me was that in the last chapter (which is also the best) I had to, as the introduction warned me, flip back and forth quite a bit, which was a bit hard at first since I&#8217;m not used to reading code on paper. I&#8217;d really love seeing some interactive version of this, but regardless of that, the book is really good.</p>
<p>I can&#8217;t recommend enough this concentrated piece of wisdom and experience.</p>
<p>Stay tuned, a review of <a href="http://www.amazon.com/gp/product/0596518382?ie=UTF8&amp;tag=thcodu02-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0596518382">Apprenticeship Patterns</a><img style="border: none !important; margin: 0px !important;" src="http://www.assoc-amazon.com/e/ir?t=thcodu02-20&amp;l=as2&amp;o=1&amp;a=0596518382" border="0" alt="" width="1" height="1" /> is nigh.</p>
<p>You should subscribe to my feed and follow me on twitter.
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codelord.net%2F2010%2F06%2F15%2Fbook-review-clean-code%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codelord.net%2F2010%2F06%2F15%2Fbook-review-clean-code%2F&amp;source=avivby&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>

<p><a href="http://feedads.g.doubleclick.net/~a/MGWMoypCuUqTe5UtVAhvEAqF-8M/0/da"><img src="http://feedads.g.doubleclick.net/~a/MGWMoypCuUqTe5UtVAhvEAqF-8M/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/MGWMoypCuUqTe5UtVAhvEAqF-8M/1/da"><img src="http://feedads.g.doubleclick.net/~a/MGWMoypCuUqTe5UtVAhvEAqF-8M/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/TheCodeDump/~4/1OzWX4WyIz0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codelord.net/2010/06/15/book-review-clean-code/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.codelord.net/2010/06/15/book-review-clean-code/</feedburner:origLink></item>
		<item>
		<title>Case Study: Refactoring Interfaces with TDDed Tests</title>
		<link>http://feedproxy.google.com/~r/TheCodeDump/~3/bsEQX0zu47A/</link>
		<comments>http://www.codelord.net/2010/06/02/case-study-refactoring-interfaces-with-tdded-tests/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 19:48:20 +0000</pubDate>
		<dc:creator>abyx</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[clean code]]></category>
		<category><![CDATA[software craftsmanship]]></category>
		<category><![CDATA[tdd]]></category>

		<guid isPermaLink="false">http://www.codelord.net/?p=190</guid>
		<description><![CDATA[I&#8217;ve been practicing TDD for a couple of years now, and keep learning all the time. In the past year I&#8217;ve been mainly working on a single project, the longest I&#8217;ve worked on a project with TDD. Putting aside how fun it is (TDD saved me quite a few times for me to be sure [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been practicing TDD for a couple of years now, and keep learning all the time.</p>
<p>In the past year I&#8217;ve been mainly working on a single project, the longest I&#8217;ve worked on a project with TDD. Putting aside how fun it is (TDD saved me quite a few times for me to be sure it&#8217;s worthwhile), working on a project for so long I finally got to see some of the main problems people have against TDD.</p>
<p>With the hundreds of test you have, refactoring on the class-interface level (that is, the interfaces of classes, and not inside classes) can be problematic, with you having to update all the tests.</p>
<p>I&#8217;m still learning how to handle this efficiently, and would like to share an experience I had today. This is an example of a problem regarding 2 collaborators and an interface change. Such refactorings in a TDD environment weren&#8217;t mentioned in the excellent &#8220;<a href="http://www.codelord.net/2010/01/12/every-coder-should-read-tdd-by-example/">TDD by Example</a>&#8221; book and similar works, so I&#8217;m pretty much guessing here.</p>
<p>The example:<br />
<script src="http://gist.github.com/422831.js?file=before+refactoring"></script></p>
<p>The change we&#8217;re interested in is making &#8220;eject&#8221; simply open the lid, without rewinding, and making the rewind operation public. This is in order to allow LazyPerson to take the tape out, without having to wait.  Gary Bernhardt <a href="http://blog.extracheese.org/2009/10/my-personal-failures-in-test-isolation.html">wrote</a> about this kind of changes a bit. I agree, the fact I need to make such a change is against the <a href="http://en.wikipedia.org/wiki/Open/closed_principle">OCP</a>. What can I say, I&#8217;m not perfect and made a design mistake. Saying &#8220;that&#8217;s not OCP&#8221; doesn&#8217;t help me &#8211; <strong>I&#8217;ve got this code and tests, and I need to change them</strong>.</p>
<p>I used to succumb to the temptation and make all the changes in one sweep. That means changing all the tests and the classes, then running the tests and hope they still pass. This, of course, is a crappy way of doing this. Had I been able to actually perform such tasks, I&#8217;d write less tests.  The secret is <strong>baby steps</strong>. The pressure Kent Beck puts on baby steps and gradually working towards change made me consider this and force myself to find a safe way of doing this.</p>
<p>I decided to start with the VCR and its test (the AutomaticPresenter doesn&#8217;t use the VCR itself but an interface, and the tests use test doubles. This means changing one part won&#8217;t break the other&#8217;s unit tests).  The path to enlightenment lies in finding the baby step that allows starting the refactoring without breaking the rest of the tests. I decided to add a test for the should-now-be-public &#8220;rewind&#8221; operation, while not breaking the existing tests.</p>
<p>The solution is adding a default value for telling the &#8220;eject&#8221; function whether it should rewind or not. This means existing users (be them tests or not) will still get the previous behavior, and new tests can start work with the new interface (in Java I&#8217;d probably do this with method overloading): <script src="http://gist.github.com/422856.js?file=mid+refactoring"></script></p>
<p>This got me to <span style="color: #00ff00;">green</span> pretty fast. Now I can slowly remove every rewind-related assertion from the old tests and also add the &#8220;should_rewind=False&#8221; flag to them, all with quick-green cycles. And we&#8217;re done with the first half.</p>
<p>The next move is to change the AutomaticPresenter to call &#8220;rewind&#8221; before &#8220;eject&#8221;, which is now really easy to do in the tests. Once we hit green, we remove the &#8220;should_rewind&#8221; flag and be done with the refactoring. Baby steps save the day:<br />
<script src="http://gist.github.com/422862.js?file=post+refatoring"></script></p>
<p>Being able to get the refactoring working so easily makes me happy, but I&#8217;m still not sure this is the smartest way, and there are harder refactorings to master ahead. Yet, I hope this will help TDD adopters see that it&#8217;s possible to handle refactorings even with many tests, because once the right baby-step is found, each test can take practically seconds to convert.</p>
<p>I&#8217;d really love getting feedback on this cycle.</p>
<p>You should subscribe to my <a href="http://feeds.feedburner.com/TheCodeDump">RSS</a> feed or follow me on <a href="http://www.twitter.com/avivby">twitter</a>!
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codelord.net%2F2010%2F06%2F02%2Fcase-study-refactoring-interfaces-with-tdded-tests%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codelord.net%2F2010%2F06%2F02%2Fcase-study-refactoring-interfaces-with-tdded-tests%2F&amp;source=avivby&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>

<p><a href="http://feedads.g.doubleclick.net/~a/bAukgbfBZ_x0RuvWNP1fGfJmT2w/0/da"><img src="http://feedads.g.doubleclick.net/~a/bAukgbfBZ_x0RuvWNP1fGfJmT2w/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/bAukgbfBZ_x0RuvWNP1fGfJmT2w/1/da"><img src="http://feedads.g.doubleclick.net/~a/bAukgbfBZ_x0RuvWNP1fGfJmT2w/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/TheCodeDump/~4/bsEQX0zu47A" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codelord.net/2010/06/02/case-study-refactoring-interfaces-with-tdded-tests/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.codelord.net/2010/06/02/case-study-refactoring-interfaces-with-tdded-tests/</feedburner:origLink></item>
		<item>
		<title>Stop Apologizing for Your Code</title>
		<link>http://feedproxy.google.com/~r/TheCodeDump/~3/GtITS40vnxY/</link>
		<comments>http://www.codelord.net/2010/05/13/stop-apologizing-for-your-code/#comments</comments>
		<pubDate>Thu, 13 May 2010 18:13:14 +0000</pubDate>
		<dc:creator>abyx</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.codelord.net/?p=179</guid>
		<description><![CDATA[Have a habit of apologizing for your code before showing it to someone else? You&#8217;re doing it wrong. I&#8217;ve been the only TDDer in my team for about a year now. When I just joined the team, my TDD ways were looked at as a weird fad. Nevertheless, I kept working in my ways, know [...]]]></description>
			<content:encoded><![CDATA[<p>Have a habit of apologizing for your code before showing it to someone else? <em>You&#8217;re doing it wrong.</em></p>
<p>I&#8217;ve been the only TDDer in my team for about a year now. When I just joined the team, my <a href="http://www.codelord.net/2010/01/12/every-coder-should-read-tdd-by-example/">TDD</a> ways were looked at as a weird fad. Nevertheless, I kept working in my ways, know that, at least for me, it works best.</p>
<p>Working like that can be very frustrating. You make sure your code is clean, well tested and refactored. Then comes along someone that makes a small change and your tests no longer cover that part of the code. You open up some other part of the system, see bad code and though you try to follow the <a href="http://bit.ly/ba2Dvt">boy-scout rule</a>, you can&#8217;t because you&#8217;d need to harness 10 computers and a goat to test the code in its current state.</p>
<p>A few months ago I asked Uncle Bob what is a programmer to do in such a situation. <a href="http://bit.ly/aWGu3s">His</a> <a href="http://bit.ly/9Yhxhj">response</a>:</p>
<blockquote><p>It&#8217;s frustrating and difficult. But what choice do you have? All you can do is keep at it. Shame the others by keeping to your disciplines.</p></blockquote>
<p>And boy was he right. As months passed, and people glancing over saw me running hundreds of tests in a second and being able to make quick changes without fear (or very little), I noticed a weird pattern.</p>
<p>Whenever people asked me to lend them a hand with a piece of code, the presentation of the code started with a disclaimer: &#8220;<em>Never mind how ugly it is</em>&#8220;, and <em>&#8220;I know it looks bad&#8221;</em>.</p>
<p>At first, my ego always happy to boast, I took it as a compliment. Later, it dawned on me that it&#8217;s not that my code looks like pure prose simply because it&#8217;s TDDed.</p>
<p>What that apologizing means is &#8220;<strong><em>I&#8217;m sorry I don&#8217;t care about the code as much you do</em><span style="font-weight: normal;">&#8220;. Uncle Bob was right, people were actually <em>ashamed</em>. Sounds weird right? But then again, if you do care, why haven&#8217;t you removed the need to apologize after the second time? </span></strong></p>
<p><strong><span style="font-weight: normal;">Get out of this shame-phase. Being ashamed means you care, do something with it. The next step is simply making the code cleaner. Some of my team-mates have already started down the enlightened path. </span></strong></p>
<p><strong><span style="font-weight: normal;">Remember, coding is a social activity. When you disrespect the code, you disrespect your friends. When you <em>rock on</em>, you <em>all</em> enjoy. As a wise man <a href="http://bit.ly/aLE5dp">said</a>, keep working on your code till <strong><em>you’re ready to project the code onto the wall for the whole team to see.</em></strong></span></strong></p>
<p><strong><span style="font-weight: normal;">And if you&#8217;re in my shoes, keep it up. <a href="http://www.codelord.net/2009/04/04/sometimes-all-it-takes-is-a-little-push/">Sometimes all it takes is a little push</a>.</span></strong></p>
<p><strong><span style="font-weight: normal;">You should subscribe to my <a href="http://feeds.feedburner.com/TheCodeDump">feed</a> and follow me on <a href="http://twitter.com/avivby">twitter</a>!</span></strong>
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codelord.net%2F2010%2F05%2F13%2Fstop-apologizing-for-your-code%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codelord.net%2F2010%2F05%2F13%2Fstop-apologizing-for-your-code%2F&amp;source=avivby&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>

<p><a href="http://feedads.g.doubleclick.net/~a/xTCiT43BtY2XFjsxPZgfaSho0oU/0/da"><img src="http://feedads.g.doubleclick.net/~a/xTCiT43BtY2XFjsxPZgfaSho0oU/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xTCiT43BtY2XFjsxPZgfaSho0oU/1/da"><img src="http://feedads.g.doubleclick.net/~a/xTCiT43BtY2XFjsxPZgfaSho0oU/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/TheCodeDump/~4/GtITS40vnxY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codelord.net/2010/05/13/stop-apologizing-for-your-code/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.codelord.net/2010/05/13/stop-apologizing-for-your-code/</feedburner:origLink></item>
		<item>
		<title>Notes From the (First?) Israeli Code Retreat</title>
		<link>http://feedproxy.google.com/~r/TheCodeDump/~3/gcT-FTLs8GU/</link>
		<comments>http://www.codelord.net/2010/05/10/notes-from-the-first-israeli-code-retreat/#comments</comments>
		<pubDate>Mon, 10 May 2010 16:12:52 +0000</pubDate>
		<dc:creator>abyx</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[software craftsmanship]]></category>

		<guid isPermaLink="false">http://www.codelord.net/?p=173</guid>
		<description><![CDATA[Today I had the honor of running a Code Retreat right here in our little country. A Code Retreat is a concept that was born in the beginning of 2009. It&#8217;s a day that consists of a bunch of programmers working in pairs about a problem &#8211; a session is 40 minutes long and after [...]]]></description>
			<content:encoded><![CDATA[<p>Today I had the honor of running a Code Retreat right here in our little country.</p>
<p>A <a href="http://www.coderetreat.com/">Code Retreat</a> is a concept that was born in the beginning of 2009. It&#8217;s a day that consists of a bunch of programmers working in pairs about a problem &#8211; a session is 40 minutes long and after each pairs rotate and the start from scratch.</p>
<p>This code retreat was a bit special. It wasn&#8217;t a public one. My previous employer liked the concept and I was asked to help with running one for some of their coders. The group consisted of 15 coders that are in the company at least 2 years.</p>
<p>Most of the people don&#8217;t pair at work and none TDD (only some unit test). Because of this we&#8217;ve decided before starting not to make TDD a must, but introduce it and encourage trying it out.</p>
<p>One of the things that surprised me was that after 3 sessions, some people asked if it was possible to get a different exercise. I haven&#8217;t heard of a code retreat with more than 1 exercise and I&#8217;m puzzled why this team has brought this up. Currently, my only guess is that the Israeli temper and to-the-point attitude (&#8220;Dugri&#8221; or &#8220;Takhles&#8221; in Hebrew)  caused it (even though there were many wicked implementation ideas running around). I&#8217;m still not sure giving them another option was a good thing, as I believe squeezing more ideas from one exercise is where things get really interesting (and some preferred staying with the original one).</p>
<p>Another point was that some people said they would have appreciated more structure/direction &#8211; what to do in each session and getting a list of implementation ideas for Game of Life.</p>
<p>We were also asked for longer sessions &#8211; 40 minutes felt like too little and our single 50 minutes session felt more like it.</p>
<p>A bit unsurprisingly, when we performed the <a href="http://bit.ly/aSwMdV">String Calculator Kata</a> to demonstrate some TDD, most people thought this was going overboard with tests for such a simple thing. I hope some got the message and I think that the fact we actually had bugs caught instantly by the tests helped!</p>
<p>To sum it up, I think that all-in-all people had a good time. I practically had to pull some from the keyboard at the end of sessions. Can&#8217;t wait for the next one! I&#8217;m thinking of getting a bunch of <a href="http://bit.ly/aPug4e">Clean Code wrist bands</a> to give away.</p>
<p>For future reference, here&#8217;s the list of <a href="http://bit.ly/cePVyl">Game of Life</a> ideas people have tried:</p>
<ul>
<li>Cell centered</li>
<li>Board/Universe centered</li>
<li>if-less (as possible)</li>
<li>Uber-threaded (each cell is a thread)</li>
<li>Performance-centered (board is a byte array)</li>
<li>Focus on the neighboring-connection (the &#8220;lines&#8221; between cells)</li>
<li>Implement in a few different languages and their idioms (we had Java, Python and some C)</li>
<li>Different topologies (hive-like and 3D)</li>
<li>Calculate results by hashing certain parts of the universe and the expected results for them</li>
</ul>
<p>And, the second problem that was given is the Poker Hands Kata:</p>
<ul>
<li>Go through the cards and seek the best hand</li>
<li>After each card is added to the hand, hand-types that are no more possible are removed</li>
<li>Encode the hand as a 64bit number, and then find better hand by subtracting the numbers</li>
</ul>
<p>You should subscribe to my <a href="http://feeds.feedburner.com/TheCodeDump">feed</a> and follow me on <a href="http://twitter.com/avivby">twitter</a>!
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codelord.net%2F2010%2F05%2F10%2Fnotes-from-the-first-israeli-code-retreat%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codelord.net%2F2010%2F05%2F10%2Fnotes-from-the-first-israeli-code-retreat%2F&amp;source=avivby&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>

<p><a href="http://feedads.g.doubleclick.net/~a/4Ob_GLNNhK-LC10PqM9lAkFgJh8/0/da"><img src="http://feedads.g.doubleclick.net/~a/4Ob_GLNNhK-LC10PqM9lAkFgJh8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/4Ob_GLNNhK-LC10PqM9lAkFgJh8/1/da"><img src="http://feedads.g.doubleclick.net/~a/4Ob_GLNNhK-LC10PqM9lAkFgJh8/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/TheCodeDump/~4/gcT-FTLs8GU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codelord.net/2010/05/10/notes-from-the-first-israeli-code-retreat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.codelord.net/2010/05/10/notes-from-the-first-israeli-code-retreat/</feedburner:origLink></item>
		<item>
		<title>Case Study: Single Responsibility Principle Violation</title>
		<link>http://feedproxy.google.com/~r/TheCodeDump/~3/RhZYQblGU9M/</link>
		<comments>http://www.codelord.net/2010/05/09/case-study-single-responsibility-principle-violation/#comments</comments>
		<pubDate>Sun, 09 May 2010 18:15:25 +0000</pubDate>
		<dc:creator>abyx</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[clean code]]></category>
		<category><![CDATA[software craftsmanship]]></category>

		<guid isPermaLink="false">http://www.codelord.net/?p=159</guid>
		<description><![CDATA[Having recently finished the amazing PPP book (more here) my code-sense is getting better in putting the finger on the smells in code that make it painful for me to use. This is the story of one of them, in Buildbot. Disclaimer: Buildbot is a pretty awesome building/continuous integration system that I use and contribute [...]]]></description>
			<content:encoded><![CDATA[<p>Having recently finished the amazing PPP book (more <a href="http://www.codelord.net/2010/05/02/agile-software-development-you-will-never-code-the-same-again/">here</a>) my code-sense is getting better in putting the finger on the smells in code that make it painful for me to use. This is the story of one of them, in <a href="http://buildbot.net/">Buildbot</a>.</p>
<p>Disclaimer: Buildbot is a pretty awesome building/continuous integration system that I use and contribute code to regularly. Indeed, it is far from perfect, but none of the coders should take offense.</p>
<p>So, what is the Single Responsibility Principle (<a href="http://bit.ly/bs003B">SRP</a>) ?</p>
<blockquote><p><strong>A class should have one, and only one, reason to change.</strong></p>
<div id="_mcePaste">If a class has more than one responsibility, then the responsibilities become coupled. Changes to one responsibility may impair or inhibit the class’ ability to meet the others. This kind of coupling leads to fragile designs that break in unexpected ways when changed.</div>
</blockquote>
<div>And now, to the gory details. Buildbot has a built-in class for executing shell commands, called <em>ShellCommand</em>. Now let&#8217;s say we want to create a class, <em>VerboseCommand</em> that always executes commands with the &#8216;<em>-v</em>&#8216; flag. One would assume this is the right way to do it:</div>
<p><script src="http://gist.github.com/395295.js"></script> But this turns out to be wrong. Say we tried to execute &#8216;<em>nosetests</em>&#8216;, the actual command that will be executed is &#8216;<em>nosetests -v -v</em>&#8216; (which is harmless, but you might have guessed my real use-case wasn&#8217;t adding the &#8216;<em>-v</em>&#8216; flag).  The reason is, as the <a href="http://djmitche.github.com/buildbot/docs/0.7.12/#Writing-BuildStep-Constructors">Buildbot manual</a> will happily tell you, that <strong>every step is also its own factory</strong>.</p>
<p>Wait, what? Given the fact the a certain step will need to be run in multiple builds on multiple slaves, a new one needs to be created every time. But, as a user you only instantiate the step once. Turns out that behind the scenes, Buildbot will save the arguments given to the command&#8217;s constructor and call it with them again every time it needs a new instance.</p>
<p>This means that in our case, we must find a way to tell in the constructor whether we&#8217;re instantiating the factory or being instantiated by the factory, and add the flag only in one case but not both. My cute example turns to this mess:  <script src="http://gist.github.com/395302.js"></script></p>
<p>(If you&#8217;re really bothered with understanding every detail, read the <a href="http://djmitche.github.com/buildbot/docs/0.7.12/#Writing-BuildStep-Constructors">manual</a>, but I&#8217;m sure you can get the gist of it without doing so.)</p>
<p>Now, if you&#8217;re anything like me, you&#8217;re looking at this and wondering something along the lines of &#8220;<em>what the hell were they thinking?</em>&#8220;. That feeling, that tingling in your code-sense, is the smell of an SRP violation.</p>
<p>Because this class has to also act as its own constructor, the coupling between the two actions is high, and as the definition clearly states, the class now has 2 reasons to change.</p>
<p>Surely, separating this to 2 different classes (the actual step and a factory) will have solved this problem elegantly. Given that this might be considered &#8220;advanced&#8221; usage I&#8217;m willing to accept that creating a factory will be <em>optional</em>. But really people, this <em>addFactoryArguments</em> screams <em>HACK</em>.</p>
<p>If you liked this post, you&#8217;ll definitely want to read the <a href="http://www.codelord.net/2010/05/02/agile-software-development-you-will-never-code-the-same-again/">PPP book</a>.</p>
<p>You should subscribe to my <a href="http://feeds.feedburner.com/TheCodeDump">feed</a> and follow me on <a href="http://twitter.com/avivby">twitter</a>!
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codelord.net%2F2010%2F05%2F09%2Fcase-study-single-responsibility-principle-violation%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codelord.net%2F2010%2F05%2F09%2Fcase-study-single-responsibility-principle-violation%2F&amp;source=avivby&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>

<p><a href="http://feedads.g.doubleclick.net/~a/Y7vAcysaiyne_hoeykmXtCEc3Cc/0/da"><img src="http://feedads.g.doubleclick.net/~a/Y7vAcysaiyne_hoeykmXtCEc3Cc/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Y7vAcysaiyne_hoeykmXtCEc3Cc/1/da"><img src="http://feedads.g.doubleclick.net/~a/Y7vAcysaiyne_hoeykmXtCEc3Cc/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/TheCodeDump/~4/RhZYQblGU9M" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codelord.net/2010/05/09/case-study-single-responsibility-principle-violation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.codelord.net/2010/05/09/case-study-single-responsibility-principle-violation/</feedburner:origLink></item>
		<item>
		<title>Python (nose) Test Coverage on Buildbot</title>
		<link>http://feedproxy.google.com/~r/TheCodeDump/~3/UpENFXoJHSI/</link>
		<comments>http://www.codelord.net/2010/05/09/python-nose-test-coverage-on-buildbot/#comments</comments>
		<pubDate>Sun, 09 May 2010 17:03:07 +0000</pubDate>
		<dc:creator>abyx</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[buildbot]]></category>
		<category><![CDATA[nose]]></category>

		<guid isPermaLink="false">http://www.codelord.net/?p=155</guid>
		<description><![CDATA[Once we got our builds happily running on Buildbot, there&#8217;s really no reason not to add coverage since it&#8217;s so easy (especially if you get bragging rights over your non-TDDers teammates). All you have to do is this (code is based on this blog post, with adaptations to work on slaves that don&#8217;t share directories [...]]]></description>
			<content:encoded><![CDATA[<p>Once we got our builds happily running on Buildbot, there&#8217;s really no reason not to add coverage since it&#8217;s so easy (especially if you get bragging rights over your non-TDDers teammates).</p>
<p>All you have to do is this (code is based on this <a href="http://copypasteprogrammer.blogspot.com/2010/03/buildbot-and-nose-test-coverage.html">blog post</a>, with adaptations to work on slaves that don&#8217;t share directories with the master, since the createSummary method runs on the master):</p>
<p><script src="http://gist.github.com/395269.js"></script>
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codelord.net%2F2010%2F05%2F09%2Fpython-nose-test-coverage-on-buildbot%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codelord.net%2F2010%2F05%2F09%2Fpython-nose-test-coverage-on-buildbot%2F&amp;source=avivby&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>

<p><a href="http://feedads.g.doubleclick.net/~a/Jms4ff_YY2IPKQ4yZGbquNP17qk/0/da"><img src="http://feedads.g.doubleclick.net/~a/Jms4ff_YY2IPKQ4yZGbquNP17qk/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Jms4ff_YY2IPKQ4yZGbquNP17qk/1/da"><img src="http://feedads.g.doubleclick.net/~a/Jms4ff_YY2IPKQ4yZGbquNP17qk/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/TheCodeDump/~4/UpENFXoJHSI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codelord.net/2010/05/09/python-nose-test-coverage-on-buildbot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.codelord.net/2010/05/09/python-nose-test-coverage-on-buildbot/</feedburner:origLink></item>
		<item>
		<title>Agile Software Development: You Will Never Code The Same Again</title>
		<link>http://feedproxy.google.com/~r/TheCodeDump/~3/5_V5yzzBwA4/</link>
		<comments>http://www.codelord.net/2010/05/02/agile-software-development-you-will-never-code-the-same-again/#comments</comments>
		<pubDate>Sun, 02 May 2010 18:30:17 +0000</pubDate>
		<dc:creator>abyx</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[software craftsmanship]]></category>

		<guid isPermaLink="false">http://www.codelord.net/?p=148</guid>
		<description><![CDATA[How often do you get to work along some coding superstar that&#8217;s been at it for decades? If you&#8217;re anything like me, the answer is &#8220;never&#8221;. That&#8217;s why I&#8217;ve recently decided to go after books that are aimed to fill this gap exactly. The latest is &#8220;Agile Software Development: Principles, Patterns, and Practices&#8221; by the [...]]]></description>
			<content:encoded><![CDATA[<p>How often do you get to work along some coding superstar that&#8217;s been at it for decades? If you&#8217;re anything like me, the answer is &#8220;never&#8221;. That&#8217;s why I&#8217;ve recently decided to go after books that are aimed to fill this gap exactly. The latest is <a href="http://www.amazon.com/gp/product/0135974445?ie=UTF8&amp;tag=thcodu02-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0135974445">&#8220;Agile Software Development: Principles, Patterns, and Practices&#8221;</a><img style="border: none !important; margin: 0px !important;" src="http://www.assoc-amazon.com/e/ir?t=thcodu02-20&amp;l=as2&amp;o=1&amp;a=0135974445" border="0" alt="" width="1" height="1" /> by the one and only, <a href="http://bit.ly/c9CPQn">Uncle Bob</a> (the previous is <a href="http://www.codelord.net/2010/01/12/every-coder-should-read-tdd-by-example/">&#8220;TDD by example&#8221;</a>, which gets 5 stars from me too).</p>
<h6>It&#8217;s like coding with the Uncle himself</h6>
<p>The thing I liked the most about the book, is the way it walks through (relatively) huge amounts of code. Uncle Bob shows several programming problems and walks through his design process and the implementation of the interesting parts. Reading it (even though it was written almost a decade ago) you can&#8217;t miss the fact the author has so much experience. Whenever I tried coding a solution myself before reading on, I later found out exactly where I went wrong because he somehow managed to cover every decision I made.</p>
<p>When I say it&#8217;s like coding with him, I really mean it. I don&#8217;t know how, but whenever I looked at a code sample I didn&#8217;t like for some reason, I was astonished to read &#8220;You may be wondering why I did X&#8221; the next paragraph. And, maybe less fun, is when I read something, totally agreed with it, and he went on to explain why it sucks.</p>
<p>The feeling throughout reading the book is that you get to pair with one of the best software craftsmen ever.</p>
<h6>You get experience in every paragraph</h6>
<p>A big part of the book is dedicated to talking about XP and design patterns. I&#8217;ve read several books about both and yet I didn&#8217;t find those parts in the book redundant. The reason is because Uncle Bob has managed to put a few grains of experience into whatever he talked about. Even though I&#8217;ve coded my fair share of Factories, he made me realize a few interesting concepts about them. And although I&#8217;ve done Visitors, I suddenly am a bit in love with them (which means I have to fight myself extra-hard not to introduce them everywhere).</p>
<p>If you don&#8217;t have people around you that care about coding a lot (enough to send out awesome <a href="http://bit.ly/aPug4e">Clean Code wristbands</a>, one of which I own) you&#8217;ll quickly grasp what I&#8217;m talking about. The whole writing is of an experienced mentor (which might explain why his company is called &#8220;Object Mentor&#8221;).</p>
<h6>It simply changes the way you look at coding</h6>
<p>Having gone through the <a href="http://bit.ly/bs003B">SOLID principles</a>, my whole designing process and way of thinking has changed. I can&#8217;t think of a sane developer that will refuse to put his hands on a set of principles that the best coders of the past decades have deemed as necessary for quality code.</p>
<p>Do yourself a favor and get your hands on this piece of software-craftsmanship gold-mine!</p>
<p style="direction: ltr;">Stay tuned for the next part of this series, Uncle Bob&#8217;s <a href="http://www.amazon.com/gp/product/B001GSTOAM?ie=UTF8&amp;tag=thcodu02-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B001GSTOAM">Clean Code</a><img style="border: none !important; margin: 0px !important;" src="http://www.assoc-amazon.com/e/ir?t=thcodu02-20&amp;l=as2&amp;o=1&amp;a=B001GSTOAM" border="0" alt="" width="1" height="1" />!</p>
<p>You should <a href="http://twitter.com/avivby">follow me</a> on twitter and subscribe to my <a href="http://feeds.feedburner.com/TheCodeDump">RSS feed</a>, it&#8217;s free!
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codelord.net%2F2010%2F05%2F02%2Fagile-software-development-you-will-never-code-the-same-again%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codelord.net%2F2010%2F05%2F02%2Fagile-software-development-you-will-never-code-the-same-again%2F&amp;source=avivby&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>

<p><a href="http://feedads.g.doubleclick.net/~a/Az-HHH9W-1LJtJm1zePlGklotE0/0/da"><img src="http://feedads.g.doubleclick.net/~a/Az-HHH9W-1LJtJm1zePlGklotE0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Az-HHH9W-1LJtJm1zePlGklotE0/1/da"><img src="http://feedads.g.doubleclick.net/~a/Az-HHH9W-1LJtJm1zePlGklotE0/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/TheCodeDump/~4/5_V5yzzBwA4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codelord.net/2010/05/02/agile-software-development-you-will-never-code-the-same-again/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.codelord.net/2010/05/02/agile-software-development-you-will-never-code-the-same-again/</feedburner:origLink></item>
		<item>
		<title>nose doesn’t discover tests on Solaris</title>
		<link>http://feedproxy.google.com/~r/TheCodeDump/~3/EvL1skZrJkw/</link>
		<comments>http://www.codelord.net/2010/03/03/nose-doesnt-discover-tests-on-solaris/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 14:05:31 +0000</pubDate>
		<dc:creator>abyx</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[techie]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://www.codelord.net/?p=138</guid>
		<description><![CDATA[Note: this is a technical post, to help poor souls that google this When using nose on Solaris machines, simply running nosetests without specifying the file names will not work if you are the root user. To fix this, you must either not be root, or pass nose the argument --exe. That&#8217;s it. Gory details: [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Note:</strong> this is a technical post, to help poor souls that google this <img src='http://www.codelord.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>When using <em>nose</em> on Solaris machines, simply running <em>nosetests</em> without specifying the file names will not work if you are the root user. To fix this, you must either not be root, or pass <em>nose</em> the argument <code>--exe</code>. That&#8217;s it.</p>
<p>Gory details: by default, <em>nose</em> ignores executable files. Each file it encounters it checks with <em>os.access(test_file, os.X_OK)</em> to see if it&#8217;s executable. Problem is that Solaris&#8217; <em>access</em> function always returns success for root, regardless of actual file permissions. This is discouraged by POSIX, but known behavior.</p>
<p>I hope this saves someone the 3 hours it wasted for me <img src='http://www.codelord.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.codelord.net%2F2010%2F03%2F03%2Fnose-doesnt-discover-tests-on-solaris%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.codelord.net%2F2010%2F03%2F03%2Fnose-doesnt-discover-tests-on-solaris%2F&amp;source=avivby&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>

<p><a href="http://feedads.g.doubleclick.net/~a/3A6vJ_oT_z2uJMYGF3PpuUzd2E8/0/da"><img src="http://feedads.g.doubleclick.net/~a/3A6vJ_oT_z2uJMYGF3PpuUzd2E8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/3A6vJ_oT_z2uJMYGF3PpuUzd2E8/1/da"><img src="http://feedads.g.doubleclick.net/~a/3A6vJ_oT_z2uJMYGF3PpuUzd2E8/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/TheCodeDump/~4/EvL1skZrJkw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codelord.net/2010/03/03/nose-doesnt-discover-tests-on-solaris/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.codelord.net/2010/03/03/nose-doesnt-discover-tests-on-solaris/</feedburner:origLink></item>
	</channel>
</rss>
