<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xml:lang="en" xml:base="http://timharvey.net/wp-atom.php">
	<title type="text">Tim Harvey :: Blog</title>
	<subtitle type="text">I help organizations who feel stuck</subtitle>

	<updated>2010-07-08T00:01:29Z</updated>

	<link rel="alternate" type="text/html" href="http://timharvey.net" />
	<id>http://timharvey.net/feed/atom/</id>
	

	<generator uri="http://wordpress.org/" version="3.0">WordPress</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/timharvey" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="timharvey" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><link rel="license" type="text/html" href="http://creativecommons.org/licenses/by-nc-nd/2.0/" /><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">timharvey</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://feedburner.google.com</feedburner:feedburnerHostname><entry>
		<author>
			<name>Tim Harvey</name>
						<uri>http://literacy5.com</uri>
					</author>
		<title type="html"><![CDATA[One domain moved&#8230;24 to go]]></title>
		<link rel="alternate" type="text/html" href="http://timharvey.net/2010/07/07/one-domain-moved-24-to-go/" />
		<id>http://timharvey.net/?p=580</id>
		<updated>2010-07-08T00:01:29Z</updated>
		<published>2010-07-07T23:45:40Z</published>
		<category scheme="http://timharvey.net" term="Technical Support" />		<summary type="html"><![CDATA[Yea, so I completely procrastinated on getting a bunch of domains off a server that I had setup with annual billing. Moving domains from one server to the next is one of the worst ways I can think of to spend time. I&#8217;d probably rather have a root canal. Due to the hosts billing setup, [...]]]></summary>
		<content type="html" xml:base="http://timharvey.net/2010/07/07/one-domain-moved-24-to-go/">&lt;p&gt;Yea, so I completely procrastinated on getting a bunch of domains off a server that I had setup with annual billing. Moving domains from one server to the next is one of the worst ways I can think of to spend time. I&amp;#8217;d probably rather have a root canal.&lt;/p&gt;

&lt;p&gt;Due to the hosts billing setup, I can&amp;#8217;t go month-to-month. While that creates an awful headache as I have to move every site off NOW&amp;#8230;it&amp;#8217;s best in the long-run.&lt;/p&gt;

&lt;p&gt;A friend of mine is taking over all my consulting clients so I will no longer be in the hosting business, nor responsible for clients sites if they go down. I still have a couple web-based services that I&amp;#8217;ll continue to support for a while.&lt;/p&gt;

&lt;p&gt;One or two will get shut down pretty quickly (Am I Down has already been open-sourced, and the Twitter Filter is next). ShipperTools is a bit harder to drop as it&amp;#8217;s profitable. I suppose that the maintenance time on it is next to nothing, so I&amp;#8217;ll keep it going for a while.&lt;/p&gt;

&lt;p&gt;This site was the first one to shift over. Wish me luck!&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/timharvey/~4/JutXSpfcukY" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://timharvey.net/2010/07/07/one-domain-moved-24-to-go/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://timharvey.net/2010/07/07/one-domain-moved-24-to-go/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	</entry>
		<entry>
		<author>
			<name>Tim Harvey</name>
						<uri>http://literacy5.com</uri>
					</author>
		<title type="html"><![CDATA[PPL &#8211; Falling off the wagon]]></title>
		<link rel="alternate" type="text/html" href="http://timharvey.net/2010/07/07/ppl-falling-off-the-wagon/" />
		<id>http://timharvey.net/?p=578</id>
		<updated>2010-07-07T12:56:15Z</updated>
		<published>2010-07-07T12:56:15Z</published>
		<category scheme="http://timharvey.net" term="Peer Pressure Learning" />		<summary type="html"><![CDATA[This is part of the Peer Pressure Learning 30 series. Jump to my introduction to the experiment if you haven&#8217;t been following along. Wow, this week has been a PPL catastrophe for me. The following are all lame excuses, but I&#8217;ll give them anyways. The weekend definitely kicked my butt. The ladies have all been [...]]]></summary>
		<content type="html" xml:base="http://timharvey.net/2010/07/07/ppl-falling-off-the-wagon/">&lt;p&gt;&lt;em&gt;This is part of the Peer Pressure Learning 30 series. Jump to &lt;a href="http://timharvey.net/2010/06/11/peer-pressure-learning-experiment/"&gt;my introduction to the experiment&lt;/a&gt; if you haven&amp;#8217;t been following along.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Wow, this week has been a PPL catastrophe for me. The following are all lame excuses, but I&amp;#8217;ll give them anyways.&lt;/p&gt;

&lt;p&gt;The weekend definitely kicked my butt. The ladies have all been sick, so a number of late night compounded into me not getting up early and having zero energy to blog at 11pm. So there went Sunday and Monday.&lt;/p&gt;

&lt;p&gt;Yesterday got really interesting. After doing a spontaneous 10 mile ride in the morning on the way to work (the most I&amp;#8217;ve done before is 5-6 miles), I played soccer for 90 minutes in the evening. While I was about done, I realized that I have a VPS server that will expire within a day or two that needs migrated to a server run by a friend who took over all my hosting clients. AHH!!! These sites are so old that I doubt they (or I) have the best backups around. So into panic mode I went attempting to extend my server service and get sites moved. Not good.&lt;/p&gt;

&lt;p&gt;On the bright side, Peer Pressure Exercise and Geek Fitness are looking great. I&amp;#8217;ve biked to work for three straight weeks and am beginning to get some longer rides in. Gotta look on the bright side, right? GRIN.&lt;/p&gt;

&lt;p&gt;So&amp;#8230;I&amp;#8217;m hoping to get back into it at lunch today, keeping the bleeding to just three days. If all goes well with the server move, perhaps I can get back on track before the &lt;a href="http://www.indyrb.org/"&gt;Indy.rb meetup&lt;/a&gt; next week. If not, I think the heckling might be more than I can bear!&lt;/p&gt;

&lt;p&gt;End of sob story&amp;#8230;back to the code!&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/timharvey/~4/Tdb-TBRdnl0" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://timharvey.net/2010/07/07/ppl-falling-off-the-wagon/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://timharvey.net/2010/07/07/ppl-falling-off-the-wagon/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	</entry>
		<entry>
		<author>
			<name>Tim Harvey</name>
						<uri>http://literacy5.com</uri>
					</author>
		<title type="html"><![CDATA[PPL: Day 20 &#8211; Successive Refinement Part 2]]></title>
		<link rel="alternate" type="text/html" href="http://timharvey.net/2010/07/03/ppl-day-20-successive-refinement-part-2/" />
		<id>http://timharvey.net/?p=574</id>
		<updated>2010-07-03T13:15:50Z</updated>
		<published>2010-07-03T13:15:22Z</published>
		<category scheme="http://timharvey.net" term="Peer Pressure Learning" />		<summary type="html"><![CDATA[This is part of the Peer Pressure Learning 30 series. Go read my introduction to the experiment that Miles and I embarked on. Since this is a pretty meaty chapter, I want to take my time and really internalize the lessons here. Just like a University&#8217;s capstone course, these case study chapters should apply all [...]]]></summary>
		<content type="html" xml:base="http://timharvey.net/2010/07/03/ppl-day-20-successive-refinement-part-2/">&lt;p&gt;&lt;em&gt;This is part of the Peer Pressure Learning 30 series. Go read my &lt;a href="http://timharvey.net/2010/06/11/peer-pressure-learning-experiment/"&gt;introduction to the experiment&lt;/a&gt; that &lt;a href="http://mileszs.com/"&gt;Miles&lt;/a&gt; and I embarked on.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Since this is a pretty meaty chapter, I want to take my time and really internalize the lessons here. Just like a University&amp;#8217;s capstone course, these case study chapters should apply all the lessons that came before and help me see how it all comes together.&lt;/p&gt;

&lt;p&gt;As such, I&amp;#8217;m converting the example code into the Ruby equivalent. That will both make it familiar and push me to think through why I would make the various refinements. It&amp;#8217;s also great to do some pure Ruby. I do so much that&amp;#8217;s Rails specific that I like the opportunity to get back the the core language.&lt;/p&gt;

&lt;h2&gt;Today&amp;#8217;s Reading: Reread pg 177 &amp;#8211; pg 186&lt;/h2&gt;

&lt;p&gt;I skimmed ahead a bit since I covered the same material from yesterday. I realized that I was converting the nice, clean copy of the argument parser and probably shouldn&amp;#8217;t. The text goes back in time to an earlier copy that&amp;#8217;s pretty rough, then proceeds to show how it evolved. Oops. (I thought we would be taking the nice one&amp;#8230;mucking it up with some hacky fixes, then cleaning it up)&lt;/p&gt;

&lt;p&gt;So I&amp;#8217;m taking a step backwards to code up the &amp;#8220;bad&amp;#8221; version in Ruby and will follow along with the improvements. Unless the tests are in the chapter (which I don&amp;#8217;t think I saw), I&amp;#8217;ll probably see about throwing in some rSpec as I go to fully TDD the whole thing.&lt;/p&gt;

&lt;p&gt;Out of deference to the author and all the work he did on these examples, I won&amp;#8217;t be sharing the Git repo. However, I&amp;#8217;ll look for some chunks of code that I could post to illustrate interesting points.&lt;/p&gt;

&lt;h2&gt;What&amp;#8217;s next&lt;/h2&gt;

&lt;p&gt;Always one to get going on the next thing&amp;#8230;I&amp;#8217;m already thinking about what I&amp;#8217;ll do next month. The ideas I like best involve either creating an app from scratch and applying Clean Code principles, or perhaps cleaning up my Twitter Filter or Am I Down.&lt;/p&gt;

&lt;p&gt;I may not be brave enough to commit to a full 30 days, but perhaps I can keep up the pace. Ideally, I would spend 30-60 minutes each day and post the repo and selected improvements as I go. My latest thinking is that I would implement Am I Down in Rails 3 with Reddis and maybe Mongo.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/timharvey/~4/arVDBodpnwk" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://timharvey.net/2010/07/03/ppl-day-20-successive-refinement-part-2/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://timharvey.net/2010/07/03/ppl-day-20-successive-refinement-part-2/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	</entry>
		<entry>
		<author>
			<name>Tim Harvey</name>
						<uri>http://literacy5.com</uri>
					</author>
		<title type="html"><![CDATA[PPL: Day 19 &#8211; Successive Refinement Part 1]]></title>
		<link rel="alternate" type="text/html" href="http://timharvey.net/2010/07/02/ppl-day-19-successive-refinement-part-1/" />
		<id>http://timharvey.net/?p=571</id>
		<updated>2010-07-03T02:52:33Z</updated>
		<published>2010-07-03T02:39:55Z</published>
		<category scheme="http://timharvey.net" term="Peer Pressure Learning" />		<summary type="html"><![CDATA[This is part of the Peer Pressure Learning 30 series. Go read my introduction to the experiment that Miles and I embarked on. It&#8217;s actually not too late in the evening and the whole family is asleep. It&#8217;s a good time to hit the Clean Code! The next couple chapters will be interesting to write [...]]]></summary>
		<content type="html" xml:base="http://timharvey.net/2010/07/02/ppl-day-19-successive-refinement-part-1/">&lt;p&gt;&lt;em&gt;This is part of the Peer Pressure Learning 30 series. Go read my &lt;a href="http://timharvey.net/2010/06/11/peer-pressure-learning-experiment/"&gt;introduction to the experiment&lt;/a&gt; that &lt;a href="http://mileszs.com/"&gt;Miles&lt;/a&gt; and I embarked on.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It&amp;#8217;s actually not too late in the evening and the whole family is asleep. It&amp;#8217;s a good time to hit the Clean Code! The next couple chapters will be interesting to write about. There are several extended case studies, so it&amp;#8217;s a change of pace. We&amp;#8217;ll see what comes out of them!&lt;/p&gt;

&lt;h2&gt;Today&amp;#8217;s Reading: pg 177 &amp;#8211; pg 186&lt;/h2&gt;

&lt;p&gt;Well, not a lot to say for this first portion of the chapter. I will say this, I read a ton of code and need more time to digest it. Another run-through tomorrow will help.&lt;/p&gt;

&lt;p&gt;The following made me really happy I don&amp;#8217;t used Java:&lt;/p&gt;

&lt;blockquote&gt;It&amp;#8217;s remarkable how much code is required to flesh out the details of this simple concept. One of the reasons for this is that we are using a particularly wordy language. Java, being a statically typed language, requires a lot of words in order to satisfy the type system. In a language like Ruby, Python, or Smalltalk, this program is much smaller.&lt;/blockquote&gt;

&lt;p&gt;I almost feel that to do this chapter justice, I should do just that; write it in Ruby. That way, I get a better feel for how it works and what&amp;#8217;s going on as the program changes. I think I&amp;#8217;ll lose too much in translation as I try to ignore the verbose nature of Java.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/timharvey/~4/hv_VBT5THhs" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://timharvey.net/2010/07/02/ppl-day-19-successive-refinement-part-1/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://timharvey.net/2010/07/02/ppl-day-19-successive-refinement-part-1/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	</entry>
		<entry>
		<author>
			<name>Tim Harvey</name>
						<uri>http://literacy5.com</uri>
					</author>
		<title type="html"><![CDATA[PPL: Day 18 &#8211; Emergence]]></title>
		<link rel="alternate" type="text/html" href="http://timharvey.net/2010/07/01/ppl-day-18-emergence/" />
		<id>http://timharvey.net/?p=555</id>
		<updated>2010-07-01T13:26:59Z</updated>
		<published>2010-07-01T13:04:38Z</published>
		<category scheme="http://timharvey.net" term="Peer Pressure Learning" />		<summary type="html"><![CDATA[This is part of the Peer Pressure Learning 30 series, taking me through Clean Code in 30 days. Take a gander at my introduction to the experiment if you have no idea what that means. The site I talked about yesterday, http://ErvsCafe.com is available on GitHub if you want to see the source. We&#8217;ll continue [...]]]></summary>
		<content type="html" xml:base="http://timharvey.net/2010/07/01/ppl-day-18-emergence/">&lt;p&gt;&lt;em&gt;This is part of the Peer Pressure Learning 30 series, taking me through &lt;a href="http://www.amazon.com/gp/product/0132350882?ie=UTF8&amp;#038;tag=timharvethebl-20&amp;#038;linkCode=as2&amp;#038;camp=1789&amp;#038;creative=390957&amp;#038;creativeASIN=0132350882"&gt;Clean Code&lt;/a&gt; in 30 days. Take a gander at &lt;a href="http://timharvey.net/2010/06/11/peer-pressure-learning-experiment/"&gt;my introduction to the experiment&lt;/a&gt; if you have no idea what that means.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The site I talked about yesterday, &lt;a href="http://ErvsCafe.com/"&gt;http://ErvsCafe.com&lt;/a&gt; is available on GitHub if you &lt;a href="http://github.com/vincefrancesi/ervscafe"&gt;want to see the source&lt;/a&gt;. We&amp;#8217;ll continue to update that repo as we improve the site.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;m trying really hard not to treat this chapter as a throwaway. Clearly, the author included it for a reason, but it&amp;#8217;s so small!&lt;/p&gt;

&lt;h2&gt;Today&amp;#8217;s reading: Pg 171 &amp;#8211; pg 176&lt;/h2&gt;

&lt;p&gt;This chapter was actually pretty darn good. It boils down a lot of critical concepts from the preceding text. Where the earlier chapters provided an excellent foundation of tactical (and increasingly strategic) methodologies, this chapter moved over the delivering some excellent big picture thinking. It summarizes the previous chapters beautifully using a few key rules from Kent Beck&amp;#8217;s &lt;a href="http://www.amazon.com/exec/obidos/ASIN/0201616416"&gt;Extreme Programming Explained&lt;/a&gt; (which I&amp;#8217;m going to reproduce from &lt;a href="http://martinfowler.com/articles/designDead.html"&gt;Martin Fowler&amp;#8217;s blog&lt;/a&gt;):&lt;/p&gt;

&lt;blockquote&gt;In XPE Kent gives four criteria for a simple system. In order (most important first):
&lt;ul&gt;
    &lt;li&gt;Runs all the Tests&lt;/li&gt;
    &lt;li&gt;Reveals all the intention&lt;/li&gt;
    &lt;li&gt;No duplication&lt;/li&gt;
    &lt;li&gt;Fewest number of classes or methods&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;There&amp;#8217;s a LOT of meat there. I can see this heuristic becoming extremely valuable.&lt;/p&gt;

&lt;p&gt;My biggest fault at this point is probably duplication. I really need to work on strategies for reducing duplication in my code. This challenges me to push harder on refactoring once my tests pass and the functionality works.&lt;/p&gt;

&lt;p&gt;I really &lt;a href="http://twitter.com/mileszs/status/17388878806"&gt;appreciate&lt;/a&gt; &lt;a href="http://twitter.com/joelmeador/status/17028009567"&gt;all&lt;/a&gt; &lt;a href="http://twitter.com/seeflanigan/status/17462591702"&gt;the&lt;/a&gt; &lt;a href="http://twitter.com/timnovinger/status/17330852123"&gt;encouragement&lt;/a&gt; I&amp;#8217;ve been getting to keep up the pace and keep the Peer Pressure Learning going.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/timharvey/~4/eKI6rR-5s9c" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://timharvey.net/2010/07/01/ppl-day-18-emergence/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://timharvey.net/2010/07/01/ppl-day-18-emergence/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	</entry>
		<entry>
		<author>
			<name>Tim Harvey</name>
						<uri>http://literacy5.com</uri>
					</author>
		<title type="html"><![CDATA[PPL: Day 17 &#8211; Systems Part 2]]></title>
		<link rel="alternate" type="text/html" href="http://timharvey.net/2010/06/30/ppl-day-17-systems-part-2/" />
		<id>http://timharvey.net/?p=540</id>
		<updated>2010-07-01T12:49:14Z</updated>
		<published>2010-07-01T02:55:40Z</published>
		<category scheme="http://timharvey.net" term="Peer Pressure Learning" />		<summary type="html"><![CDATA[This is part of the Peer Pressure Learning 30 series. Jump to my introduction to the experiment if you got here from Google or some other site. Several mornings this past week were taken up by building http://ervscafe.com/ with Vince. We did the site for free to help out the restaurant painfully stuffed into the [...]]]></summary>
		<content type="html" xml:base="http://timharvey.net/2010/06/30/ppl-day-17-systems-part-2/">&lt;p&gt;&lt;em&gt;This is part of the Peer Pressure Learning 30 series. Jump to &lt;a href="http://timharvey.net/2010/06/11/peer-pressure-learning-experiment/"&gt;my introduction to the experiment&lt;/a&gt; if you got here from Google or some other site.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Several mornings this past week were taken up by building &lt;a href="http://ervscafe.com/"&gt;http://ervscafe.com/&lt;/a&gt; with &lt;a href="http://twitter.com/vincefrancesi"&gt;Vince&lt;/a&gt;. We did the site for free to help out the restaurant painfully stuffed into the 7th floor of our building. We love having Erv (his real name is Kevin) around to feed us. It&amp;#8217;s a pretty ghetto site, but the idea was quick and dirty.&lt;/p&gt;

&lt;p&gt;With that pretty well done (I need to do a bit to the Rails app so he can update his specials), I&amp;#8217;m back to having a bit more time for PPL. Hopefully tonight will be my last weekday post done in the evening for a while.&lt;/p&gt;

&lt;h2&gt;Today&amp;#8217;s reading: pg 164 &amp;#8211; pg 170&lt;/h2&gt;

&lt;p&gt;While this chapter continued with a bunch of Java-specific framework details (Swing, JBoss, Beans, etc), one particular concept leapt off the page and seemed to have a potential impact on a large Rails app:&lt;/p&gt;

&lt;blockquote&gt;In Spring, you write your business logic as Plain-Old Java Objects. POJOs are purely focused on their domain. They have no dependencies on enterprise frameworks (or any other domains). Hence, they are conceptually simpler and easier to test drive.&lt;/blockquote&gt;

&lt;p&gt;Whoa! Can you imagine an entire Rails app that used Models as data containers and plain Ruby classes to hold all the business logic? It frightens be rather a lot, but the idea that all that business logic could be more easily transferred to another language, a different framework, or more easily modified sounds incredible. Separating persistence (and framework crap) from business logic sounds like win to me.&lt;/p&gt;

&lt;p&gt;Downside? That seems to fight against much of the Rails conventions and common practice, so implementing a solution in that manner would require treading very rough, new territory.&lt;/p&gt;

&lt;p&gt;I have a small portion of an app I did constructed somewhat this way. I&amp;#8217;ve been wanting to write up a blog post on the topic as it&amp;#8217;s a pretty in-depth implementation. This chapter gives me hope that I just might have been onto something purely by chance!&lt;/p&gt;

&lt;p&gt;Another great standout from the chapter is the discussion of decision making. This nails it:&lt;/p&gt;

&lt;blockquote&gt;We often forget that it is also best to postpone decisions until the last possible moment. This isn&amp;#8217;t lazy or irresponsible; it lets us make informed choices with the best possible information.&lt;/blockquote&gt;

&lt;p&gt;And finally, the best bit of all:&lt;/p&gt;

&lt;blockquote&gt;&amp;#8230;never forget to use the simplest thing that can possibly work.&lt;/blockquote&gt;

&lt;p&gt;Well said.&lt;/p&gt;

&lt;p&gt;Next up? Emergence. Again, I have no idea what that means, but it sounds impressive (it has to be, the word has 3 syllables).&lt;/p&gt;

&lt;p&gt;Miles continues to bang out his PPL blog posts. His latest is on the &lt;a href="http://mileszs.com/blog/2010/06/29/ppl30-day-16-django.html"&gt;Python framework Django&lt;/a&gt; (pronounced, &amp;#8220;JANG-go&amp;#8221;, I think).&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/timharvey/~4/A9gTGtFNWzI" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://timharvey.net/2010/06/30/ppl-day-17-systems-part-2/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://timharvey.net/2010/06/30/ppl-day-17-systems-part-2/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	</entry>
		<entry>
		<author>
			<name>Tim Harvey</name>
						<uri>http://literacy5.com</uri>
					</author>
		<title type="html"><![CDATA[Google: Please update the site i built]]></title>
		<link rel="alternate" type="text/html" href="http://timharvey.net/2010/06/30/google-please-update-this-site/" />
		<id>http://timharvey.net/2010/06/30/google-please-update-the-site-i-built/</id>
		<updated>2010-07-01T03:04:00Z</updated>
		<published>2010-06-30T21:43:26Z</published>
		<category scheme="http://timharvey.net" term="Technical Support" />		<summary type="html"><![CDATA[Dear Google, Your index is out of date and I&#8217;d love for you to revisit this site ASAP: http://factsandfiguresscotland.com/. Kthx. Tim]]></summary>
		<content type="html" xml:base="http://timharvey.net/2010/06/30/google-please-update-this-site/">&lt;p&gt;Dear Google,&lt;/p&gt;

&lt;p&gt;Your index is out of date and I&amp;#8217;d love for you to revisit this site ASAP: &lt;a href="http://factsandfiguresscotland.com/"&gt;http://factsandfiguresscotland.com/&lt;/a&gt;. Kthx.&lt;/p&gt;

&lt;p&gt;Tim&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/timharvey/~4/7J2NQsQR1Yo" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://timharvey.net/2010/06/30/google-please-update-this-site/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://timharvey.net/2010/06/30/google-please-update-this-site/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	</entry>
		<entry>
		<author>
			<name>Tim Harvey</name>
						<uri>http://literacy5.com</uri>
					</author>
		<title type="html"><![CDATA[PPL: Day 16 &#8211; Systems Part 1]]></title>
		<link rel="alternate" type="text/html" href="http://timharvey.net/2010/06/29/ppl-day-16-systems-part-1/" />
		<id>http://timharvey.net/?p=533</id>
		<updated>2010-07-01T12:50:35Z</updated>
		<published>2010-06-30T03:05:35Z</published>
		<category scheme="http://timharvey.net" term="Peer Pressure Learning" />		<summary type="html"><![CDATA[This is part of the Peer Pressure Learning 30 series. Take a gander at my introduction to the experiment. Ok, I&#8217;m back on track with two blog posts today. My Day 15b &#8211; Classes Part 2 post fills in the gap left by my Day 15- FAIL. I started into the rather heavy chapter on [...]]]></summary>
		<content type="html" xml:base="http://timharvey.net/2010/06/29/ppl-day-16-systems-part-1/">&lt;p&gt;&lt;em&gt;This is part of the Peer Pressure Learning 30 series. Take a gander at &lt;a href="http://timharvey.net/2010/06/11/peer-pressure-learning-experiment/"&gt;my introduction to the experiment&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Ok, I&amp;#8217;m back on track with two blog posts today. My &lt;a href="http://timharvey.net/2010/06/29/ppl-day-15b-classes-part-2/"&gt;Day 15b &amp;#8211; Classes Part 2 post&lt;/a&gt; fills in the gap left by my &lt;a href="http://timharvey.net/2010/06/28/ppl-day-15-fail/"&gt;Day 15- FAIL&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I started into the rather heavy chapter on systems. It&amp;#8217;s a higher level look at clean code from the architecture and strategy perspective. A ton of it was either over my head (and heavy into Java) or was tough to apply with my Ruby on Rails goggles on.&lt;/p&gt;

&lt;h2&gt;Today&amp;#8217;s reading: pg 153 &amp;#8211; 163&lt;/h2&gt;

&lt;p&gt;Wow, this was some intense stuff. Uncle Bob talked about some interesting pitfalls with coupling the instantiation and management of dependencies in with the business logic. I could see a lot of validity to the problems that causes as you get into larger and large codebases. The pain of changing out your &lt;a href="http://en.wikipedia.org/wiki/Object-relational_mapping"&gt;ORM&lt;/a&gt; already leads me to believe that Ruby on Rails projects likely suffer from some of the problems he talks about.&lt;/p&gt;

&lt;p&gt;He shared some interesting examples of how to decouple the initialization of your objects from the run-time code, but I couldn&amp;#8217;t even begin to understand how that would relate to a Rails app.&lt;/p&gt;

&lt;p&gt;I have to take a cue from Miles to make any sense of this blog post:&lt;/p&gt;

&lt;h2&gt;What I Think I Now Know&lt;/h2&gt;

&lt;p&gt;Think, think, think before you go charging down a path with your classes. The author showed an example of the ubiquitous lazy-loading method of instantiating objects that I&amp;#8217;ve used numerous times. In addition to pointing out that it may be a pre-mature optimization, he also explains that it can tie the instantiation too closely with your business logic. What does one do about that? I have no idea.&lt;/p&gt;

&lt;p&gt;Realize that your toolkit or framework may fight against what you&amp;#8217;re trying to accomplish. While I don&amp;#8217;t know what you&amp;#8217;d do about it, we have to realize that any framework we use was designed with a purpose or set of goals. Those may be different that we we need to accomplish with the current work at hand. I&amp;#8217;m not suggesting that we throw out frameworks, merely that we understand their strengths and weaknesses. And at the same time, we learn to see clearly when it&amp;#8217;s time to buck the convention or stick to it.&lt;/p&gt;

&lt;p&gt;Finally, one must accept that you can&amp;#8217;t architect any system for the needs you&amp;#8217;ll have in 12-24 months. It&amp;#8217;s just not going to work out exactly the way you expect. As believers in Agile, we need to accept change and do what supports today&amp;#8217;s requirements with basic consideration for the future. We need to be wary of over-engineering.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/timharvey/~4/zyaDtcj02Bo" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://timharvey.net/2010/06/29/ppl-day-16-systems-part-1/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://timharvey.net/2010/06/29/ppl-day-16-systems-part-1/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	</entry>
		<entry>
		<author>
			<name>admin</name>
					</author>
		<title type="html"><![CDATA[PPL: Day 15b &#8211; Classes Part 2]]></title>
		<link rel="alternate" type="text/html" href="http://timharvey.net/2010/06/29/ppl-day-15b-classes-part-2/" />
		<id>http://timharvey.net/?p=529</id>
		<updated>2010-06-30T02:28:11Z</updated>
		<published>2010-06-30T02:26:47Z</published>
		<category scheme="http://timharvey.net" term="Peer Pressure Learning" />		<summary type="html"><![CDATA[This is part of the Peer Pressure Learning 30 series. Jump to my introduction to the experiment if you haven&#8217;t been following along. Ok, it&#8217;s a day late, but I&#8217;m back on the wagon. It&#8217;s really day 16, but I&#8217;ll get back to that in a few moments. I need to play catch up first! [...]]]></summary>
		<content type="html" xml:base="http://timharvey.net/2010/06/29/ppl-day-15b-classes-part-2/">&lt;p&gt;&lt;em&gt;This is part of the Peer Pressure Learning 30 series. Jump to &lt;a href="http://timharvey.net/2010/06/11/peer-pressure-learning-experiment/"&gt;my introduction to the experiment&lt;/a&gt; if you haven&amp;#8217;t been following along.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Ok, it&amp;#8217;s a day late, but I&amp;#8217;m back on the wagon. It&amp;#8217;s really day 16, but I&amp;#8217;ll get back to that in a few moments. I need to play catch up first!&lt;/p&gt;

&lt;p&gt;I have to make a brief digression. This Peer Pressure Learning has impacted a number of areas in my life. I&amp;#8217;ve found that as I&amp;#8217;ve been more focused and disciplined, other priorities have felt more effortless.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;ve ridden my bike or walked to work almost two weeks now (with one or two breaks). That has paid off big-time for my soccer league. I&amp;#8217;ve been a lot more effective on defense and logged my first assist today to bring us back from a 1-2 deficit. Geek fitness for the win! Ok, enough of that, back to the code!&lt;/p&gt;

&lt;p&gt;I lucked out with today&amp;#8217;s reading. The balance of the Classes chapter wasn&amp;#8217;t particularly long. But, it was home to some great material about organizing your classes with an eye towards future change. It&amp;#8217;s been said a thousand ways&amp;#8230;and I&amp;#8217;ll repeat it again here: the only thing in software you can be certain of is that you&amp;#8217;ll have to change tomorrow what you wrote today.&lt;/p&gt;

&lt;h2&gt;Today&amp;#8217;s reading: pg 147 &amp;#8211; pg 152&lt;/h2&gt;

&lt;p&gt;I glossed over the Single Responsibility Principle of class design from the first portion of the text, but it was impossible to miss here. The idea is that a class with more than two responsibilities is a broken design. A couple ways to tell that one has broken the SRP (my paraphrasing from memory):&lt;/p&gt;

&lt;ul&gt;
    &lt;li&gt;Describing the class in plain english includes words like &amp;#8220;and&amp;#8221;, &amp;#8220;or&amp;#8221;, &amp;#8220;if&amp;#8221;, or &amp;#8220;unless&amp;#8221;&lt;/li&gt;
    &lt;li&gt;Finding private methods that only support a few of the public methods or private variables used by a small portion of the methods&lt;/li&gt;
    &lt;li&gt;More than one type of application change will impact the class (meaning it&amp;#8217;s probably doing more than one thing (see the first bullet)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It&amp;#8217;s pretty genius. It leads to mountains of tiny classes. Coding this way must be a complete mind shift. One couldn&amp;#8217;t do this haphazardly or you&amp;#8217;d go crazy. Lots of tiny, but complex classes would be awful. You really would have to get darn good at simplification and organization. Thank goodness for tests, you&amp;#8217;d have no way to complete a refactor otherwise!&lt;/p&gt;

&lt;p&gt;A throw-in at the end talked about one of my favorite concepts (I like it, but probably am not that great at it): Separate stuff that appears likely to change from stuff that will stay constant. Don&amp;#8217;t put them in the same class!&lt;/p&gt;

&lt;p&gt;Why do you think we have configuration files full of application constants and don&amp;#8217;t put that stuff into our classes? It&amp;#8217;s partly to eliminate duplication, but just as importantly, it&amp;#8217;s so our system can evolve through editing as few files as possible.&lt;/p&gt;

&lt;p&gt;One of my other favorite testing methods was talked about as well. When you have to interface with some external class (one that&amp;#8217;s perhaps complicated or an API), pass in the class as part of the initialization or using a setter method. That way, your tests can push in a mock object for easier validation. It also allows you to decouple your code from an external or volatile library. Nice!&lt;/p&gt;

&lt;p&gt;Next up, Chapter 11: Systems (I have no idea what the chapter is about, but it sounds cool).&lt;/p&gt;

&lt;p&gt;While I&amp;#8217;ve been slacking, Miles has been tearing it up!&lt;/p&gt;

&lt;ul&gt;
    &lt;li&gt;Day 14: &lt;a href="http://mileszs.com/blog/2010/06/27/ppl30-day-14-html5.html"&gt;HTML5&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;Day 15: &lt;a href="http://mileszs.com/blog/2010/06/28/ppl30-day-15-python.html"&gt;Python&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;img src="http://feeds.feedburner.com/~r/timharvey/~4/3idzoQ_cuoc" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://timharvey.net/2010/06/29/ppl-day-15b-classes-part-2/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://timharvey.net/2010/06/29/ppl-day-15b-classes-part-2/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	</entry>
		<entry>
		<author>
			<name>Tim Harvey</name>
						<uri>http://literacy5.com</uri>
					</author>
		<title type="html"><![CDATA[PPL: Day 15 &#8211; FAIL]]></title>
		<link rel="alternate" type="text/html" href="http://timharvey.net/2010/06/28/ppl-day-15-fail/" />
		<id>http://timharvey.net/2010/06/28/ppl-day-15-fail/</id>
		<updated>2010-06-29T03:36:20Z</updated>
		<published>2010-06-29T03:36:20Z</published>
		<category scheme="http://timharvey.net" term="Peer Pressure Learning" />		<summary type="html"><![CDATA[Yea, I managed to blow it today. It&#8217;s 11:30 and I just can&#8217;t bring myself to stay up another 30 minutes. I&#8217;ll probably look to pit through two posts in the next day or two. I&#8217;m working with a friend to build a free web site for our building&#8217;s cafe, so tomorrow will be tough. [...]]]></summary>
		<content type="html" xml:base="http://timharvey.net/2010/06/28/ppl-day-15-fail/">&lt;p&gt;Yea, I managed to blow it today. It&amp;#8217;s 11:30 and I just can&amp;#8217;t bring myself to stay up another 30 minutes.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;ll probably look to pit through two posts in the next day or two.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;m working with a friend to build a free web site for our building&amp;#8217;s cafe, so tomorrow will be tough. Wish me luck!&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/timharvey/~4/U_dGhFB3q4o" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://timharvey.net/2010/06/28/ppl-day-15-fail/#comments" thr:count="1" />
		<link rel="replies" type="application/atom+xml" href="http://timharvey.net/2010/06/28/ppl-day-15-fail/feed/atom/" thr:count="1" />
		<thr:total>1</thr:total>
	</entry>
		<entry>
		<author>
			<name>admin</name>
					</author>
		<title type="html"><![CDATA[PPL: Day 14 &#8211; Classes Part 1]]></title>
		<link rel="alternate" type="text/html" href="http://timharvey.net/2010/06/27/ppl-day-14-classes/" />
		<id>http://timharvey.net/?p=516</id>
		<updated>2010-06-30T01:54:04Z</updated>
		<published>2010-06-28T02:46:31Z</published>
		<category scheme="http://timharvey.net" term="Peer Pressure Learning" />		<summary type="html"><![CDATA[This is part of the Peer Pressure Learning 30 series. The introduction to the experiment post will make all things clear. Whew, I almost forgot tonight! That would have been my first miss. Luckily, after toying with the Facebook API and FQL for a while, it dawned on me that I needed to finish reading [...]]]></summary>
		<content type="html" xml:base="http://timharvey.net/2010/06/27/ppl-day-14-classes/">&lt;p&gt;&lt;em&gt;This is part of the Peer Pressure Learning 30 series. The &lt;a href="http://timharvey.net/2010/06/11/peer-pressure-learning-experiment/"&gt;introduction to the experiment&lt;/a&gt; post will make all things clear.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Whew, I almost forgot tonight! That would have been my first miss. Luckily, after toying with the Facebook API and FQL for a while, it dawned on me that I needed to finish reading the chapter on Classes (which I started this morning) and blog!&lt;/p&gt;

&lt;h2&gt;Today&amp;#8217;s reading: pg 135 &amp;#8211; pg 146&lt;/h2&gt;

&lt;p&gt;Having read a chunk of &lt;a href="http://www.amazon.com/gp/product/0735619670?ie=UTF8&amp;#038;tag=timharvethebl-20&amp;#038;linkCode=as2&amp;#038;camp=1789&amp;#038;creative=390957&amp;#038;creativeASIN=0735619670"&gt;Code Complete&lt;/a&gt;, thinking about clean, concise classes isn&amp;#8217;t entirely new. I was pleased to find that Uncle Bob isn&amp;#8217;t fanatical about perfection, sometimes bending the rules on privacy:&lt;/p&gt;

&lt;blockquote&gt;For us, tests rule. If a test in the same package needs to call a function or access a variable, we&amp;#8217;ll make it protected&amp;#8230;&lt;/blockquote&gt;

&lt;p&gt;Nice, that had been bothering me for a month or two. It seems that my larger classes end up with a private method or two that I&amp;#8217;d like to test. They&amp;#8217;re tested by virtue of the public methods being tested, but a targeted test would help at times. I didn&amp;#8217;t like the idea of making them public, so this strikes a nice balance.&lt;/p&gt;

&lt;p&gt;As with functions, the author makes it clean that they should be small, and then you should go back and make them smaller still. But&amp;#8230;he makes a great distinction: &amp;#8220;with functions we measured size by counting physical lines. With classes we use a different measure. We count &lt;em&gt;responsibilities&lt;/em&gt;&amp;#8220;. Oh man, genius!&lt;/p&gt;

&lt;h2&gt;Fighting with Rails&lt;/h2&gt;

&lt;p&gt;I&amp;#8217;m clearly still new to Rails and find that the conventions seem to fight against the larger OOP concepts at times. I&amp;#8217;m sure that as I get more comfortable with the plumbing (and hell, Ruby itself) that I&amp;#8217;ll find all this easier. I read the following a struggle to know how to make such nice-sounding organization a reality in a world of &amp;#8220;fat models&amp;#8221;:&lt;/p&gt;

&lt;blockquote&gt;At the same time, many developers fear that a large number of small, single-purpose classes makes it more difficult to understand the bigger picture. They are concerned that they must navigate from class to class in order to figure out how a larger piece of work gets accomplished.&lt;/blockquote&gt;

&lt;p&gt;&lt;/br&gt;&lt;/p&gt;

&lt;blockquote&gt;However, a system with many small classes has no more moving parts that a system with a few large classes. There is just as much to learn in the system with a few large classes. So the question is: Do you want your tools organized into toolboxes with many small drawers each containing well-defined and well-labeled components? Or do you want a few drawers you toss everything into?&lt;/blockquote&gt;

&lt;p&gt;It&amp;#8217;s crazy stuff. While I like the idea of small drawers, I suspect that I would end up creating a ton of tiny drawers that don&amp;#8217;t have the requisite organization. Time will tell!&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/timharvey/~4/odnjH97rInA" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://timharvey.net/2010/06/27/ppl-day-14-classes/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://timharvey.net/2010/06/27/ppl-day-14-classes/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	</entry>
		<entry>
		<author>
			<name>admin</name>
					</author>
		<title type="html"><![CDATA[PPL: Day 13 &#8211; Unit Tests]]></title>
		<link rel="alternate" type="text/html" href="http://timharvey.net/2010/06/26/ppl-day-13-unit-tests/" />
		<id>http://timharvey.net/?p=511</id>
		<updated>2010-06-30T01:53:13Z</updated>
		<published>2010-06-27T01:30:59Z</published>
		<category scheme="http://timharvey.net" term="Insights" />		<summary type="html"><![CDATA[This is part of the Peer Pressure Learning 30 series. Get a handle on this PPL thing with my introduction to the experiment. It&#8217;s the weekend, so I&#8217;m back to the evening groove. The morning was relaxed and the whole family and I went to visit the Amish farm that we buy all our meat, [...]]]></summary>
		<content type="html" xml:base="http://timharvey.net/2010/06/26/ppl-day-13-unit-tests/">&lt;p&gt;&lt;em&gt;This is part of the Peer Pressure Learning 30 series. Get a handle on this PPL thing with my &lt;a href="http://timharvey.net/2010/06/11/peer-pressure-learning-experiment/"&gt;introduction to the experiment&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It&amp;#8217;s the weekend, so I&amp;#8217;m back to the evening groove. The morning was relaxed and the whole family and I went to visit the Amish farm that we buy all our meat, eggs, and chicken from. But that&amp;#8217;s another blog post.&lt;/p&gt;

&lt;p&gt;Today&amp;#8217;s posts is on unit tests. I&amp;#8217;m trying not to be a snob as the Ruby community seems to really have testing nailed. Between Rspec and Cucumber, I&amp;#8217;m in heaven. I have to remind myself that there&amp;#8217;s a lot to learn from the Java community and especially about writing good tests.&lt;/p&gt;

&lt;h2&gt;Today&amp;#8217;s reading: pg 121 &amp;#8211; pg 134&lt;/h2&gt;

&lt;p&gt;Uncle Bob seems to nail me with every chapter. I have been, for the most part, a self-taught programmer. The programming courses I took in college were a joke that I dominated in my sleep, so I jumped over to a business degree so I could learn something I didn&amp;#8217;t know. But therein lies the problem. Until now, I&amp;#8217;ve never had a systematic approach to polishing my craft. This line from the text describes me to a T:&lt;/p&gt;

&lt;blockquote&gt;&amp;#8230;in the mad rush to add testing to our discipline, many programmers have missed some of the more subtle, and important, points of writing good tests.&lt;/blockquote&gt;

&lt;p&gt;Some really good points come out of the chapter:&lt;/p&gt;

&lt;ul&gt;
    &lt;li&gt;Test code should match the code quality of production code &amp;#8211; I can relate here&amp;#8230;test code changes all the time as the requirements change. If your tests are crap, you&amp;#8217;ll pay for it every time you have to rewrite tests. Changing over to using Factories has been a perfect example. The tests stay DRY and have been much easier to maintain since the change. Uncle Bob (the author) correctly says: &amp;#8220;Test code is just as important as production code.&amp;#8221;&lt;/li&gt;
    &lt;li&gt;Tests give you courage &amp;#8211; That&amp;#8217;s a weird thing to say, and it&amp;#8217;s definitely my interpretation of the text. But&amp;#8230;it really is true. I have tremendous faith in the test suites I use in each of my apps. Because of the safety net they provide, I can rename large models, change big chunks of logic, or refactor sections of tricky code without fear. My tests tell me when I&amp;#8217;m done! I couldn&amp;#8217;t go back to a non-TDD (test driven development) language ever again (or one with sucky TDD tools). I really mean that. I&amp;#8217;d be hard as hell.&lt;/li&gt;
    &lt;li&gt;One assert per test&amp;#8230;probably &amp;#8211; I like that Uncle Bob feels free to break the rules. While it&amp;#8217;s a good goal to shoot for one assert per test, the added code and duplication may negate the benefit. I find that I frequently pair a record count assert with an assertion about what&amp;#8217;s in the record. The better guideline is to test one behavior (the text says, &amp;#8220;concept&amp;#8221;) per test.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All in all, I feel pretty good about where I stand with test code. I definitely need to hone my comfort level with the tools I use, particularly to reduce duplication.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;m totally pumped about tomorrows reading which begins a journey into the depths of classes and their proper composition.&lt;/p&gt;

&lt;p&gt;If you&amp;#8217;re ready to melt your brain on some wild code stuff, read Miles&amp;#8217; &lt;a href="http://mileszs.com/blog/2010/06/25/ppl30-day-12-factor.html"&gt;post on Factor&lt;/a&gt;, a crazy weird stack language that&amp;#8217;s unlike anything you&amp;#8217;ve even seen.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/timharvey/~4/3BO9lwNGTeM" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://timharvey.net/2010/06/26/ppl-day-13-unit-tests/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://timharvey.net/2010/06/26/ppl-day-13-unit-tests/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	</entry>
		<entry>
		<author>
			<name>Tim Harvey</name>
						<uri>http://literacy5.com</uri>
					</author>
		<title type="html"><![CDATA[PPL: Day 12 &#8211; Boundaries]]></title>
		<link rel="alternate" type="text/html" href="http://timharvey.net/2010/06/25/ppl-day-12-boundaries/" />
		<id>http://timharvey.net/?p=509</id>
		<updated>2010-06-25T12:47:31Z</updated>
		<published>2010-06-25T12:47:31Z</published>
		<category scheme="http://timharvey.net" term="Peer Pressure Learning" />		<summary type="html"><![CDATA[This is part of the Peer Pressure Learning 30 series. The introduction to the experiment post will make all things clear. Today&#8217;s already been a fun day. Vince, my partner in crime at the office, and I got up early and started banging out a free web site for our building&#8217;s cafe. It&#8217;s a great [...]]]></summary>
		<content type="html" xml:base="http://timharvey.net/2010/06/25/ppl-day-12-boundaries/">&lt;p&gt;&lt;em&gt;This is part of the Peer Pressure Learning 30 series. The &lt;a href="http://timharvey.net/2010/06/11/peer-pressure-learning-experiment/"&gt;introduction to the experiment&lt;/a&gt; post will make all things clear.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Today&amp;#8217;s already been a fun day. Vince, my partner in crime at the office, and I got up early and started banging out a free web site for our building&amp;#8217;s cafe. It&amp;#8217;s a great little restaurant on the seventh floor that needs some help with a bit of marketing. Look for http://ErvsCafe.com/ soon.&lt;/p&gt;

&lt;p&gt;I also had a blast this morning reading about software boundaries. It&amp;#8217;s a pretty important topic when you begin considering larger systems.&lt;/p&gt;

&lt;h2&gt;Today&amp;#8217;s reading: pg 113 &amp;#8211; pg 120&lt;/h2&gt;

&lt;p&gt;The general idea is that we need to manage how our code interacts with software written by someone else, or that might change frequently. It&amp;#8217;s really another look at coupling.&lt;/p&gt;

&lt;p&gt;Rather than sprinkling code all through our app that uses a particular gem, we&amp;#8217;re encouraged to write a wrapper class so that it&amp;#8217;s less disruptive (sorry &lt;a href="http://disruptiveventures.com/"&gt;Jerry&lt;/a&gt;). That way, we can swap out an uploader / asset gem with something else and don&amp;#8217;t have to rewrite large swaths of the application&amp;#8217;s code. This comment about such classes sums it up best:&lt;/p&gt;

&lt;blockquote&gt;It is able to evolve with very little impact on the rest of the application&lt;/blockquote&gt;

&lt;p&gt;There&amp;#8217;s a wonderful gem in this chapter. The section on exploring and learning boundaries offers some excellent advice on getting used to and beginning to integrate a new library.&lt;/p&gt;

&lt;p&gt;One of my big takeaways was the authors encouragement to write tests that exercise the new library. It forces you to begin learning the library&amp;#8217;s API and documents your understanding. It also acts as a safety net when the library updates. You&amp;#8217;ll know immediately if some portion of the API you are familiar with changes. These are the kind of test, in my world, that I&amp;#8217;d leave for the CI server to run once they&amp;#8217;re in place. There&amp;#8217;s no sense in running them regularly unless you&amp;#8217;re working with changing out that library.&lt;/p&gt;

&lt;p&gt;Looking for some more PPL goodness? Take a peek at Miles&amp;#8217; &lt;a href="http://mileszs.com/blog/2010/06/23/ppl30-day-10-erlang.html"&gt;Day 10 post on Erlang&lt;/a&gt;!&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/timharvey/~4/e9fZJdDHrTM" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://timharvey.net/2010/06/25/ppl-day-12-boundaries/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://timharvey.net/2010/06/25/ppl-day-12-boundaries/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	</entry>
		<entry>
		<author>
			<name>Tim Harvey</name>
						<uri>http://literacy5.com</uri>
					</author>
		<title type="html"><![CDATA[PPL: Day 11 &#8211; Error handling]]></title>
		<link rel="alternate" type="text/html" href="http://timharvey.net/2010/06/24/ppl-day-11-error-handling/" />
		<id>http://timharvey.net/?p=505</id>
		<updated>2010-06-24T13:05:42Z</updated>
		<published>2010-06-24T13:00:47Z</published>
		<category scheme="http://timharvey.net" term="Insights" />		<summary type="html"><![CDATA[This is part of the Peer Pressure Learning 30 series. Read my my introduction to the experiment to learn more. After two days on Objects and Data Structures, I felt like I was beginning to get a better handle on the concepts. I&#8217;m pumped about today&#8217;s topic as I&#8217;ve just been pondering how to handle [...]]]></summary>
		<content type="html" xml:base="http://timharvey.net/2010/06/24/ppl-day-11-error-handling/">&lt;p&gt;&lt;em&gt;This is part of the Peer Pressure Learning 30 series. Read my &lt;a href="http://timharvey.net/2010/06/11/peer-pressure-learning-experiment/"&gt;my introduction to the experiment&lt;/a&gt; to learn more.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;After two days on Objects and Data Structures, I felt like I was beginning to get a better handle on the concepts. I&amp;#8217;m pumped about today&amp;#8217;s topic as I&amp;#8217;ve just been pondering how to handle bad inputs (to libraries) and thinking about alerting (to me) of recoverable error conditions.&lt;/p&gt;

&lt;h2&gt;Today&amp;#8217;s reading: pg 103 &amp;#8211; pg 112&lt;/h2&gt;

&lt;p&gt;This statement kicks off the chapter on the right foot for me, setting the stage:&lt;/p&gt;

&lt;blockquote&gt;Error handling is important, but if it obscures the logic, it&amp;#8217;s wrong.&lt;/blockquote&gt;

&lt;p&gt;Nice. Definitely not playing around on this topic! This was particularly valuable as the discussion turned to null values in arguments and return values.&lt;/p&gt;

&lt;p&gt;Two critical sections were particularly timely for me, titled &amp;#8220;Don&amp;#8217;t return null&amp;#8221; and &amp;#8220;Don&amp;#8217;t pass null&amp;#8221;. I had really been struggling with this and as a result, been adding .nil? checks all over my code. I just had a conversation about it yesterday and was at a loss about what to do.&lt;/p&gt;

&lt;p&gt;Now, it&amp;#8217;s funny because I failed to take several things into account:&lt;/p&gt;

&lt;ul&gt;
    &lt;li&gt;Rails already has some great error handling, so if a null creeps in somewhere, the user gets a nice error message and Hoptoad helpfully kicks me in the mouth with a nice shiny stack trace.&lt;/li&gt;
    &lt;li&gt;While it&amp;#8217;s definitely worth coding defensively, my code is the only code that calls the methods I&amp;#8217;m worried about, so I can trap for bad user input long before it gets into the libraries.&lt;/li&gt;
    &lt;li&gt;Throwing exceptions is not a bad practice. I read a blog post talking about bad usage of exceptions to control program flow and have since stayed away from them. Dumb. In several cases, I&amp;#8217;d been returning nil as a flag that something had gone wrong and allowed the caller to deal with it. That&amp;#8217;s pretty lame. Thinking now, I realize that I could define some sensible exceptions and allow the caller to handle each differently depending on the situation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Chances are good that most of my .nil? checks are pointless and only satisfy test cases that I created in rspec. Boo. Time to rip some stuff out because as they say, &amp;#8220;No code is better than no code.&amp;#8221;&lt;/p&gt;

&lt;p&gt;So&amp;#8230;all that to say, there&amp;#8217;s some tremendous wisdom in what author Uncle Bob shares. He sums it up nicely by saying:&lt;/p&gt;

&lt;blockquote&gt;If you are tempted to return null from a method, consider throwing an exception or returning a special case object instead.&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;* Note: A special case object would be one that looks and acts like the typically returned object. For example, Rails ActiveRecord #all method typically returns an enumerated list of model instances. When no records exist, it returns an empty array instead of nil. That plays nicely with a .each loop, saving us from trapping for nil.&lt;/em&gt;&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/timharvey/~4/fmPGS9DBaVI" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://timharvey.net/2010/06/24/ppl-day-11-error-handling/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://timharvey.net/2010/06/24/ppl-day-11-error-handling/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	</entry>
		<entry>
		<author>
			<name>Tim Harvey</name>
						<uri>http://literacy5.com</uri>
					</author>
		<title type="html"><![CDATA[PPL: Day 10 &#8211; Objects &amp; Data Structures Part 2]]></title>
		<link rel="alternate" type="text/html" href="http://timharvey.net/2010/06/23/ppl-day-10-objects-and-data-structures-part-2/" />
		<id>http://timharvey.net/?p=499</id>
		<updated>2010-06-23T12:11:52Z</updated>
		<published>2010-06-23T12:10:29Z</published>
		<category scheme="http://timharvey.net" term="Peer Pressure Learning" />		<summary type="html"><![CDATA[This is part of the Peer Pressure Learning 30 series. You can read all about it. Yesterday&#8217;s late morning led to a last-minute blog post. Thankfully, I read the text earlier in the day as it really warranted some consideration. Thankfully today, I&#8217;m back to the early groove. Today&#8217;s reading: pg 99 &#8211; pg 102 [...]]]></summary>
		<content type="html" xml:base="http://timharvey.net/2010/06/23/ppl-day-10-objects-and-data-structures-part-2/">&lt;p&gt;&lt;em&gt;This is part of the Peer Pressure Learning 30 series. You can &lt;a href="http://timharvey.net/2010/06/11/peer-pressure-learning-experiment/"&gt;read all about it&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Yesterday&amp;#8217;s late morning led to a last-minute blog post. Thankfully, I read the text earlier in the day as it really warranted some consideration. Thankfully today, I&amp;#8217;m back to the early groove.&lt;/p&gt;

&lt;h2&gt;Today&amp;#8217;s reading: pg 99 &amp;#8211; pg 102&lt;/h2&gt;

&lt;p&gt;The chapter&amp;#8217;s concepts begin to take shape with the balance of the chapter read. While it&amp;#8217;s really tough to see how it fits in with the rather opinionated Rails framework. I&amp;#8217;d be rather interested in talking through concepts in this chapter as they relate to MVC.&lt;/p&gt;

&lt;p&gt;The crux of the matter is the distinction between data structures (dumb classes that hold data) and objects (super-smart classes that operate on data structures). I quoted from the text yesterday, but really should have used this rewording of the Law of Demeter (a &amp;#8220;well known heuristic&amp;#8221;):&lt;/p&gt;

&lt;blockquote&gt;a module should not know about the inards of the objects in manipulates&lt;/blockquote&gt;

&lt;p&gt;That talks about objects, not data structures. The idea is that objects know &lt;strong&gt;very&lt;/strong&gt; little about other objects in the system. They are allowed to chain through and know a &lt;strong&gt;ton&lt;/strong&gt; about data structures, even if they&amp;#8217;re chained several layers deep.&lt;/p&gt;

&lt;h2&gt;Ruby on Rails&lt;/h2&gt;

&lt;p&gt;So, what about Ruby on Rails? Clearly, the whole discussion is moot when you&amp;#8217;re looking at a site/system with less than 5,000 lines of real code. It&amp;#8217;s probably not large enough to worry about splitting into separate objects and data structures. Rails&amp;#8217; models hide enough functionality that a model can stay reasonably sized and satisfy the needs of a hybrid object / data structure. It&amp;#8217;s a concern of balance, really. While a purist may demand that the smallest app utilize all the associated patterns and follow OOP to the T, I&amp;#8217;m not in that camp. I&amp;#8217;ve done enough consulting to realize that you have to balance cost (time) with the benefits (rather low in small projects).&lt;/p&gt;

&lt;p&gt;A larger app begins to make the whole discussion rather interesting. I seriously have no answers on this side of the topic. If I&amp;#8217;m taking the text properly, one would begin to make the models increasingly small, leaving validations and associations behind (and probably some of the callbacks). You&amp;#8217;d then move more and more logic into library objects.&lt;/p&gt;

&lt;p&gt;How the heck would that work? Hmm&amp;#8230;I&amp;#8217;m not really sure. I&amp;#8217;ve done some work on having the model call a factory that instantiates the associated libraries, but I could also see some of that logic going into the controller. Putting it into the controller seems to be a great opportunity to duplicate code (not good). I think I like the idea of the model starting the process.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;d love to hear from anyone with experience on really large, complex Rails projects. Talking through the concepts with someone experienced with 20-50k lines.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/timharvey/~4/-Kh-Fj_j5zM" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://timharvey.net/2010/06/23/ppl-day-10-objects-and-data-structures-part-2/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://timharvey.net/2010/06/23/ppl-day-10-objects-and-data-structures-part-2/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	</entry>
		<entry>
		<author>
			<name>admin</name>
					</author>
		<title type="html"><![CDATA[PPL: Day 9 &#8211; Objects and Data Structures Part 1]]></title>
		<link rel="alternate" type="text/html" href="http://timharvey.net/2010/06/22/ppl-day-9-objects-and-data-structures-part-1/" />
		<id>http://timharvey.net/?p=494</id>
		<updated>2010-06-23T11:11:13Z</updated>
		<published>2010-06-23T03:05:29Z</published>
		<category scheme="http://timharvey.net" term="Peer Pressure Learning" />		<summary type="html"><![CDATA[This is part of the Peer Pressure Learning 30 series. Take a peek at my introduction to the experiment Miles and I embarked on. This was a tricky section to get through today. I&#8217;m long past the comfortable passages that I&#8217;ve read over in the past and into the more conceptual material. I think it [...]]]></summary>
		<content type="html" xml:base="http://timharvey.net/2010/06/22/ppl-day-9-objects-and-data-structures-part-1/">&lt;p&gt;&lt;em&gt;This is part of the Peer Pressure Learning 30 series. Take a peek at my &lt;a href="http://timharvey.net/2010/06/11/peer-pressure-learning-experiment/"&gt;introduction to the experiment&lt;/a&gt; &lt;a href="http://mileszs.com/"&gt;Miles&lt;/a&gt; and I embarked on.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This was a tricky section to get through today. I&amp;#8217;m long past the comfortable passages that I&amp;#8217;ve read over in the past and into the more conceptual material. I think it will require some more thought and review to really think through properly.&lt;/p&gt;

&lt;h2&gt;Today&amp;#8217;s reading: pg 93 &amp;#8211; 98&lt;/h2&gt;

&lt;p&gt;I stopped a bit short, so there isn&amp;#8217;t as much to cover today, but one clear message came through. Think really carefully about the methods you make public. If you go down the road of opening up the entire class, you dangerously couple classes together. Your like is much more difficult down the road when you need to change a class when you have no idea which methods are in use.&lt;/p&gt;

&lt;p&gt;Instead, choose the bare minimum to expose and hide as much as possible. That way, you may easily gut and re-implement the entirety of the private methods while preserving the same interface.&lt;/p&gt;

&lt;p&gt;I find that Rails makes this particularly tough. By default, every model exposes getters and setters for all attributes. That&amp;#8217;s really great in the world I come from, building simple marketing focused sites with a bit of app thrown in for good measure (to drive a CMS, email form, or simple CRM).&lt;/p&gt;

&lt;p&gt;When it comes to developing a serious app with tons of models, associated libraries, and complexity galore&amp;#8230;it can become quite challenging to keep everything clean and concise. I find that I rarely think in terms of the API a class provides. I can juggle the whole system (barely) in my head, so all classes generally know about whatever I feel like.&lt;/p&gt;

&lt;p&gt;I was really blown away by this statement (in the context of describing the Law of Demeter), and have no idea whether this would be possible for me:&lt;/p&gt;

&lt;blockquote&gt;A method should &lt;em&gt;not&lt;/em&gt; invoke methods on objects that are returned by any of the allowed functions. In other words, talk to friends, not to strangers.&lt;/blockquote&gt;

&lt;p&gt;Wow&amp;#8230;how does one do that? The answer (which I don&amp;#8217;t fully grasp) has to do with the authors distinction between objects and data structures (one being full of behavior, and the latter being just a container for data). It&amp;#8217;s a pretty wild and interesting concept. I&amp;#8217;m fascinated to see how I can apply it in the Ruby on Rails world.&lt;/p&gt;

&lt;p&gt;Peeking ahead a bit, it seems that some of the answers I need may come later in the chapter.&lt;/p&gt;

&lt;p&gt;Feeling like all this code structure talk is mamby-pamby? I don&amp;#8217;t blame you. Head over to Miles blog for his introduction to a language that will put hair on your chest: &lt;a href="http://mileszs.com/blog/2010/06/21/ppl30-day-8-clojure.html"&gt;Closure&lt;/a&gt;.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/timharvey/~4/9L2lNcWaFHo" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://timharvey.net/2010/06/22/ppl-day-9-objects-and-data-structures-part-1/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://timharvey.net/2010/06/22/ppl-day-9-objects-and-data-structures-part-1/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	</entry>
		<entry>
		<author>
			<name>Tim Harvey</name>
						<uri>http://literacy5.com</uri>
					</author>
		<title type="html"><![CDATA[PPL: Day 8 &#8211; Horizontal formatting]]></title>
		<link rel="alternate" type="text/html" href="http://timharvey.net/2010/06/21/ppl-day-8-horizontal-formatting/" />
		<id>http://timharvey.net/?p=490</id>
		<updated>2010-06-21T12:44:23Z</updated>
		<published>2010-06-21T12:30:24Z</published>
		<category scheme="http://timharvey.net" term="Peer Pressure Learning" />		<summary type="html"><![CDATA[This is part of the Peer Pressure Learning 30 series. Go read my introduction to the experiment Miles and I embarked on. Monday morning and I&#8217;m back on track. It&#8217;s barely 8:00am and I have my reading done. Today&#8217;s reading: pg 85 &#8211; pg 92 This section on horizontal formatting really challenged some of my [...]]]></summary>
		<content type="html" xml:base="http://timharvey.net/2010/06/21/ppl-day-8-horizontal-formatting/">&lt;p&gt;&lt;em&gt;This is part of the Peer Pressure Learning 30 series. Go read my &lt;a href="http://timharvey.net/2010/06/11/peer-pressure-learning-experiment/"&gt;introduction to the experiment&lt;/a&gt; &lt;a href="http://mileszs.com/"&gt;Miles&lt;/a&gt; and I embarked on.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Monday morning and I&amp;#8217;m back on track. It&amp;#8217;s barely 8:00am and I have my reading done.&lt;/p&gt;

&lt;h2&gt;Today&amp;#8217;s reading: pg 85 &amp;#8211; pg 92&lt;/h2&gt;

&lt;p&gt;This section on horizontal formatting really challenged some of my thoughts on code. As I said before, I&amp;#8217;m a bit of a geek for formatting code a certain way. Uncle Bob (the author) isn&amp;#8217;t as infatuated with the little &amp;#8220;beauty&amp;#8221; details as I sometimes am. I routinely line up assignment operators, hashrockets, or any other element that&amp;#8217;s repeated on multiple lines. He points out some reasons not to do that, despite the visual appeal.&lt;/p&gt;

&lt;p&gt;An example of my hyperactive horizontal alignment from the &lt;a href="http://twitter-proxy-production.heroku.com/"&gt;filtering Twitter Proxy&lt;/a&gt; I wrote:&lt;/p&gt;

&lt;script src='http://pastie.org/1013462.js'&gt;&lt;/script&gt;

&lt;p&gt;A couple differences in his coding style that I want to ponder further:&lt;/p&gt;

&lt;ul&gt;
    &lt;li&gt;You probably shouldn&amp;#8217;t break indentation &amp;#8211; When a block can be done on one line or indented over several, the author explains that he almost always (he of course, used Java) went back to the indented multi-line version. In the example below. the &amp;#8220;return true&amp;#8221; is the critical element, the thing that actually executes. That shouldn&amp;#8217;t be hidden in the middle of the line. Rather, it&amp;#8217;s indented and it&amp;#8217;s scope is clearly shown. (Note: I did use the more Ruby-ish inline if statement. I felt that to be a reasonable breakage of standard indenting&amp;#8230;but maybe it isn&amp;#8217;t!)&lt;/li&gt;

&lt;script src='http://pastie.org/1013463.js'&gt;&lt;/script&gt;
    
      &lt;li&gt;Don&amp;#8217;t necessarily line up similar elements &amp;#8211; I find that I almost always line up like elements in named_scopes, routes, associations, etc. The author makes an interesting point that while you may be making the code more aesthetically pleasing, you can obscure relevant differences. The code becomes too easy to scan, allowing someone to miss critical elements of the code. The example below may be as stretch, but I could see someone missing the difference between the TRUE and FALSE. I guess one must weigh the value of showing how similar the two statements are with making their difference clear.&lt;/li&gt;

&lt;script src='http://pastie.org/1013469.js'&gt;&lt;/script&gt;

&lt;/ul&gt;

&lt;p&gt;I&amp;#8217;m interested to talk with my team about implementing some basic style guidelines. The text talks about a situation the author was in where they spend just 10 minutes making some decisions that affected the whole project. That tells me that it doesn&amp;#8217;t have to be a long, drawn out affair.&lt;/p&gt;

&lt;p&gt;What will get interesting for a web app project is that we have to integrate several different languages. I&amp;#8217;m already finding that I have to tone down the amount of Ruby-specific stuff as we have to shift from Ruby to JS to HTML and each has its own common idioms. That&amp;#8217;s what makes this fun!&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/timharvey/~4/Tp_y7NWwA9U" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://timharvey.net/2010/06/21/ppl-day-8-horizontal-formatting/#comments" thr:count="2" />
		<link rel="replies" type="application/atom+xml" href="http://timharvey.net/2010/06/21/ppl-day-8-horizontal-formatting/feed/atom/" thr:count="2" />
		<thr:total>2</thr:total>
	</entry>
		<entry>
		<author>
			<name>Tim Harvey</name>
						<uri>http://literacy5.com</uri>
					</author>
		<title type="html"><![CDATA[PPL: Day 7 &#8211; Vertical formatting]]></title>
		<link rel="alternate" type="text/html" href="http://timharvey.net/2010/06/20/ppl-day-7-vertical-formatting/" />
		<id>http://timharvey.net/?p=482</id>
		<updated>2010-06-21T11:44:21Z</updated>
		<published>2010-06-21T02:40:45Z</published>
		<category scheme="http://timharvey.net" term="Peer Pressure Learning" />		<summary type="html"><![CDATA[This is part of the Peer Pressure Learning 30 series. The introduction to the experiment post will make all things clear. Once again, the weekend has almost been my undoing. I may have to accept that the weekend requires doing PPL at night before bed with weekdays sticking to the morning routine. Today&#8217;s reading: pg [...]]]></summary>
		<content type="html" xml:base="http://timharvey.net/2010/06/20/ppl-day-7-vertical-formatting/">&lt;p&gt;&lt;em&gt;This is part of the Peer Pressure Learning 30 series. The &lt;a href="http://timharvey.net/2010/06/11/peer-pressure-learning-experiment/"&gt;introduction to the experiment&lt;/a&gt; post will make all things clear.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Once again, the weekend has almost been my undoing. I may have to accept that the weekend requires doing PPL at night before bed with weekdays sticking to the morning routine.&lt;/p&gt;

&lt;h2&gt;Today&amp;#8217;s reading: pg 75 &amp;#8211; pg 84&lt;/h2&gt;

&lt;p&gt;Chapter 5 kicks off discussions of code formatting, a topic I really enjoy. I&amp;#8217;m a complete freak for making sure my hashrockets line up, there&amp;#8217;s no whitespace at the end of a line of code, etc. I&amp;#8217;d like to say that it&amp;#8217;s because I have some specific value on professionalism or neatness, but that would be a load of crap. For whatever reason, I spot little inconsistencies and they drive me nuts&amp;#8230;it&amp;#8217;s probably a bit OCD because I&amp;#8217;m sure that I blindly skip over the stupid stuff I do that others hate.&lt;/p&gt;

&lt;p&gt;Clean Code has kept the discussion rather focused on the utilitarian side. &lt;a href="http://twitter.com/orderedlist"&gt;Steve Smith&lt;/a&gt;&amp;#8216;s talk at the &lt;a href="http://greatlakesrubybash.com/"&gt;Great Lakes Ruby Bash&lt;/a&gt; on &amp;#8220;&lt;a href="http://www.slideshare.net/orderedlist/designing-code"&gt;Designing Code&lt;/a&gt;&amp;#8221; takes the whole concept in a direction I love.&lt;/p&gt;

&lt;div style="width:425px" id="__ss_3758673"&gt;&lt;strong style="display:block;margin:12px 0 4px"&gt;&lt;a href="http://www.slideshare.net/orderedlist/designing-code" title="Designing code"&gt;Designing code&lt;/a&gt;&lt;/strong&gt;&lt;object id="__sse3758673" width="425" height="355"&gt;&lt;param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=designingcode-100417085231-phpapp01&amp;#038;stripped_title=designing-code" /&gt;&lt;param name="allowFullScreen" value="true"/&gt;&lt;param name="allowScriptAccess" value="always"/&gt;&lt;embed name="__sse3758673" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=designingcode-100417085231-phpapp01&amp;#038;stripped_title=designing-code" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div style="padding:5px 0 12px"&gt;View more &lt;a href="http://www.slideshare.net/"&gt;presentations&lt;/a&gt; from &lt;a href="http://www.slideshare.net/orderedlist"&gt;Steve Smith&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The author gave some great suggestions about how to sort the methods within a class. I&amp;#8217;ve always wondered about that as mine end up being a mish-mash, depending on when I added a method. He suggests that:&lt;/p&gt;

&lt;ul&gt;
    &lt;li&gt;Methods are defined below the point where they&amp;#8217;re first called&lt;/li&gt;
    &lt;li&gt;Like methods go together (they are logically or actually connected)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;He also spends some time talking about proper whitespace, limiting files to a reasonable length (files over 500 lines may indicate a concept that&amp;#8217;s too large for a single class), and keeping in mind that you&amp;#8217;re in the business of communicating. I love this introduction to the chapter:&lt;/p&gt;

&lt;blockquote&gt;Code formatting is about communication, and communication is the professional developer&amp;#8217;s first order of business. Perhaps you thought that &amp;#8220;getting it working&amp;#8221; was the first order of business for a professional developer. I hope by now, however, that this book has disabused you of that idea. The functionality that you create today has a good chance of changing in the next release, but the readability of your code will have a profound effect on all the changes that will ever be made. The coding style and readability set precedents that continue long after the original code has bee changed beyond recognition.&lt;/blockquote&gt;

&lt;p&gt;Good stuff.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/timharvey/~4/woRap3Nre8k" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://timharvey.net/2010/06/20/ppl-day-7-vertical-formatting/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://timharvey.net/2010/06/20/ppl-day-7-vertical-formatting/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	</entry>
		<entry>
		<author>
			<name>Tim Harvey</name>
						<uri>http://literacy5.com</uri>
					</author>
		<title type="html"><![CDATA[PPL: Day 6 &#8211; Bad comments]]></title>
		<link rel="alternate" type="text/html" href="http://timharvey.net/2010/06/19/ppl-day-6-bad-comments/" />
		<id>http://timharvey.net/?p=479</id>
		<updated>2010-06-21T11:43:42Z</updated>
		<published>2010-06-20T03:21:37Z</published>
		<category scheme="http://timharvey.net" term="Peer Pressure Learning" />		<summary type="html"><![CDATA[This is part of the Peer Pressure Learning 30 series. Jump to my introduction to the experiment if you got here from Google or some other site. This is my first weekend PPL day and it almost broke me! It&#8217;s been a heavy week, so I was barely able to fall out of bed. Even [...]]]></summary>
		<content type="html" xml:base="http://timharvey.net/2010/06/19/ppl-day-6-bad-comments/">&lt;p&gt;&lt;em&gt;This is part of the Peer Pressure Learning 30 series. Jump to &lt;a href="http://timharvey.net/2010/06/11/peer-pressure-learning-experiment/"&gt;my introduction to the experiment&lt;/a&gt; if you got here from Google or some other site.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This is my first weekend PPL day and it almost broke me! It&amp;#8217;s been a heavy week, so I was barely able to fall out of bed. Even then, it was 30 minutes later than usual and the kids were already going full steam. So here I am at 10:53pm because I really care a ton about this stuff. Thank goodness I got a Kindle copy of Clean Code as the paper one is collecting dust on my desk this weekend.&lt;/p&gt;

&lt;p&gt;As a brief aside, I got a ton out of &lt;a href="http://garyvaynerchuk.com/post/688601116/railsconf-2010-keynote"&gt;Gary V&amp;#8217;s talk from RailsConf&lt;/a&gt;. I listened to it three times today. His push to make sure you do what really means something to you resonates a ton with me. Go watch it!&lt;/p&gt;

&lt;p&gt;Enough rambling!&lt;/p&gt;

&lt;h2&gt;Today&amp;#8217;s reading: pg 59 &amp;#8211; 74&lt;/h2&gt;

&lt;p&gt;The section shares a rather long list of bad comment habits and styles. I couldn&amp;#8217;t begin to do them justice. My thought is to share a few of the mistakes I&amp;#8217;ve found myself making of late. Having jumped into my first group project (I never coded on anything with more than one full-time developer), I quickly got accustomed to writing comments. I didn&amp;#8217;t do it at first, but our team lead quickly pointed out the damage that my sparse commenting would eventually cause. Now, about 6 months in, I think I&amp;#8217;ve gone too far. I&amp;#8217;m finding that I include header blocks on almost every method, no matter how obvious it&amp;#8217;s purpose:&lt;/p&gt;

&lt;script src='http://pastie.org/1012008.js'&gt;&lt;/script&gt;

&lt;p&gt;The worst thing I do (and I find that I do it in conversation, emails, and IM) is getting crazy wordy in comments. I&amp;#8217;m so enthusiastic to explain what&amp;#8217;s going on, why we implemented things the way we did, etc. that I&amp;#8217;ve written small novels is a couple sections of code. Worst of all, they&amp;#8217;re so long that it would be difficult to tech edit them later to make sure it&amp;#8217;s all still accurate! Arg!&lt;/p&gt;

&lt;p&gt;My goal for this week will be to cut the redundant/obvious comments. I&amp;#8217;ll also look to use shorter, simple language when describing concepts. And when I find something that&amp;#8217;s sufficiently complex to seemingly require a short book&amp;#8230;I&amp;#8217;ll see what can be done to simplify things. Wish me luck!&lt;/p&gt;

&lt;p&gt;Take a moment (or save it into Instapaper&amp;#8230;the most wonderful too ever) to read &lt;a href="http://mileszs.com/blog/2010/06/18/ppl-30-day-5-scala.html"&gt;Miles&amp;#8217; Day 5 post on Scala&lt;/a&gt;!&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/timharvey/~4/OSK0qDwJgY0" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://timharvey.net/2010/06/19/ppl-day-6-bad-comments/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://timharvey.net/2010/06/19/ppl-day-6-bad-comments/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	</entry>
		<entry>
		<author>
			<name>Tim Harvey</name>
						<uri>http://literacy5.com</uri>
					</author>
		<title type="html"><![CDATA[PPL: Day 5 &#8211; Good comments]]></title>
		<link rel="alternate" type="text/html" href="http://timharvey.net/2010/06/18/ppl-day-5-good-comments/" />
		<id>http://timharvey.net/?p=468</id>
		<updated>2010-06-18T13:02:14Z</updated>
		<published>2010-06-18T12:55:43Z</published>
		<category scheme="http://timharvey.net" term="Peer Pressure Learning" />		<summary type="html"><![CDATA[This is part of the Peer Pressure Learning 30 series. Be sure to read my introduction to the experiment if this doesn&#8217;t make sense to you! It&#8217;s Friday, and I&#8217;m a little apprehensive about PPL, heading into the weekend. I&#8217;ve made great progress this week, reading and blogging all week long. I need to keep [...]]]></summary>
		<content type="html" xml:base="http://timharvey.net/2010/06/18/ppl-day-5-good-comments/">&lt;p&gt;&lt;em&gt;This is part of the Peer Pressure Learning 30 series. Be sure to read &lt;a href="http://timharvey.net/2010/06/11/peer-pressure-learning-experiment/"&gt;my introduction to the experiment&lt;/a&gt; if this doesn&amp;#8217;t make sense to you!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://dontbreakthechain.com/share/timharvey/one-up/40350"&gt;&lt;img src="http://timharvey.net/wp-content/Screen-shot-2010-06-18-at-8.56.39-AM1.png" alt="" title="PPL Chain" width="222" height="269" class="alignleft size-full wp-image-474" /&gt;&lt;/a&gt;
It&amp;#8217;s Friday, and I&amp;#8217;m a little apprehensive about PPL, heading into the weekend. I&amp;#8217;ve made great progress this week, reading and blogging all week long. I need to keep the big mo going and stay on the wagon. Here&amp;#8217;s my progress thus far (and yes, I counted the several days of ramp-up blogging&amp;#8230;don&amp;#8217;t judge me):&lt;/p&gt;

&lt;p&gt;Today&amp;#8217;s reading was on Comments. I made it through the first section on &amp;#8220;Good comments&amp;#8221;. I stopped my reading short before hitting the rather long &amp;#8220;bad comments&amp;#8221; heading.&lt;/p&gt;

&lt;h2&gt;Today&amp;#8217;s reading: pg 53 &amp;#8211; pg 59&lt;/h2&gt;

&lt;p&gt;If you&amp;#8217;re a developer, I can&amp;#8217;t recommend Clean Code enough. It&amp;#8217;s been tremendous already. There were so many good points that jumped out to me, I don&amp;#8217;t feel like I could do them justice by summarizing them. So instead, I want to quote some of my favorite lines:&lt;/p&gt;

&lt;ul&gt;
    &lt;li&gt;If our programming languages were expressive enough, or if we had the talent to subtly wield those languages to express our intent, we would not need comments very much &amp;#8212; perhaps not at all.&lt;/li&gt;
    &lt;li&gt;The proper use of comments is to compensate for our failure to express ourself in code. Note that I used the word &lt;em&gt;failure&lt;/em&gt;. I meant it. Comments are always failures.&lt;/li&gt;
    &lt;li&gt;Why am I so down on comments? Because they lie. Not always, and not intentionally, but too often. The older a comment is, and the farther away it is from the code it describes, the more likely it is to be just plain wrong. The reason is simple. Programmers can&amp;#8217;t realistically maintain them.&lt;/li&gt;
    &lt;li&gt;Truth can only be found in one place: the code.&lt;/li&gt;
    &lt;li&gt;Some comments are necessary or beneficial. Keep in mind, however, that the only truly good comment is the comment you found a way not to write.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I&amp;#8217;m working on an OSS &lt;a href="http://github.com/tjh/should-i-stfu"&gt;Twitter app&lt;/a&gt; that scores people&amp;#8217;s level of annoying. I put together this code to cache a single user&amp;#8217;s Twitter account details, only updating them (calling out to a slow API) every 24 hours. The #find_by_username runs the whole show. I love how crisp that method is now (it was a wreck 24 hours ago. The tests are all dirt simple now, it&amp;#8217;s really great.&lt;/p&gt;

&lt;p&gt;Coming on the heels of the previous chapter on writing small methods and this chapter on comments, I&amp;#8217;m extremely proud of this class. It reads well and may not need any comments!&lt;/p&gt;

&lt;script src='http://pastie.org/1009990.js'&gt;&lt;/script&gt;

&lt;p&gt;Here&amp;#8217;s an earlier version (and if you can imagine&amp;#8230;it was worse before this):&lt;/p&gt;

&lt;script src='http://pastie.org/1010002.js'&gt;&lt;/script&gt;

&lt;p&gt;For more PPL fun, head over to Miles&amp;#8217; blog for his &lt;a href="http://mileszs.com/blog/2010/06/17/ppl-30-day-4-mongodb.html"&gt;post on MongoDB&lt;/a&gt;.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/timharvey/~4/84snfhgh7fA" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://timharvey.net/2010/06/18/ppl-day-5-good-comments/#comments" thr:count="1" />
		<link rel="replies" type="application/atom+xml" href="http://timharvey.net/2010/06/18/ppl-day-5-good-comments/feed/atom/" thr:count="1" />
		<thr:total>1</thr:total>
	</entry>
	</feed>
