<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>has_many :thoughts: Clean Code</title>
    <link>http://blog.kineticweb.com/articles/2007/05/18/clean-code</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Musings from a Ruby on Rails development team</description>
    <item>
      <title>Clean Code</title>
      <description>&lt;p&gt;I just saw a talk by Robert Martin called &#8220;Clean Code&#8221; that was pretty eye opening. He walked through the process of coding a small app that parsed command line parameters. He demonstrated a rather common process of creating a small application with a specific function that, when requirements change, can quickly and easily morph into a mess of unmanageable code.&lt;/p&gt;


	&lt;p&gt;This is a problem we encounter often and was one of my main complaints the &lt;span class="caps"&gt;ASP&lt;/span&gt; applications that we were churning out. We can&amp;#8217;t do anything about clients changing requirements, but we can do something about how we keep up with them.&lt;/p&gt;


	&lt;p&gt;A few points to take a away:&lt;/p&gt;


	&lt;ol&gt;
	&lt;li&gt;Writing clean code is more important than you think.
	&lt;ul&gt;
	&lt;li&gt;It often seems like a better choice to just get the app done, and worry about the details later. But later almost always requires more work.&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
		&lt;li&gt;Test-first development is the way to go. 
	&lt;ul&gt;
	&lt;li&gt;The speaker is an agile development consultant and so he advocated test-first development, of course.&lt;/li&gt;
		&lt;li&gt;It was pretty clear to me that refactoring becomes a lot easier, because you can do it with confidence, when you have tests that can ensure that your code still works.&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
		&lt;li&gt;Improve code every time you check in.
	&lt;ul&gt;
	&lt;li&gt;When you add some functionality to an app, make it a habit of always improving something else at the same time.&lt;/li&gt;
		&lt;li&gt;A small investment of say, 10% additional work, every time you commit code, of improvement and refactoring of other code will go a long way to improving the app overall. Again, you can do this more confidently when you have tests.&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
		&lt;li&gt;Reading other people&amp;#8217;s code is a great way to learn.
	&lt;ul&gt;
	&lt;li&gt;It was pretty interesting to read someone else&amp;#8217;s code and learn how they would approach a problem. This is why things like Ruby Quiz are so helpful.&lt;/li&gt;
	&lt;/ol&gt;&lt;/li&gt;
	&lt;/ul&gt;</description>
      <pubDate>Fri, 18 May 2007 15:13:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:a2e2871b-d7bc-43f7-a660-6cf6d7577585</guid>
      <author>Colin A. Bartlett</author>
      <link>http://blog.kineticweb.com/articles/2007/05/18/clean-code</link>
      <category>Rails</category>
      <category>RailsConf</category>
      <category>RailsConf07</category>
      <category>TDD</category>
    </item>
  </channel>
</rss>
