<?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>Object Mentor Blog: Clues For Reading New Code</title>
    <link>http://blog.objectmentor.com/articles/2008/03/05/clues-for-reading-new-code</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>Clues For Reading New Code</title>
      <description>&lt;p&gt;Okay, somebody just handed you a new chunk of code to work on.  Your first though on opening the file is &amp;#8220;Why, dear God, why?&amp;#8221;.  How do you get a handle on this masterpiece of clever programming?  Let&amp;#8217;s look for a few clues.&lt;/p&gt;


	&lt;p&gt;Where to start?&lt;/p&gt;


&lt;h2&gt;Documents&lt;/h2&gt;

	&lt;p&gt;Why not look at the documentation? &amp;lt;&lt;strong&gt;laughs&lt;/strong&gt;&amp;gt; Just kidding.  You know there&amp;#8217;s no documentation, and it&amp;#8217;s probably not useful.&lt;/p&gt;


&lt;h2&gt;People and Interactions&lt;/h2&gt;

	&lt;p&gt;You need a partner who is familiar with the code. Having a guide is better than having a map. Not only will you know where to go, but you&amp;#8217;ll know &amp;#8217;&amp;#8217;how&amp;#8217;&amp;#8217; to go and where not to step. Other people are a wonderful resource. Just don&amp;#8217;t settle for someone doing the work in front of you&amp;#8230; the goal is to learn as much as to do.&lt;/p&gt;


&lt;h2&gt;No, really, documents!&lt;/h2&gt;

	&lt;p&gt;&lt;span class="caps"&gt;OTOH&lt;/span&gt;, if you have somethng in the way of a summary or architectural overview, that might help. I&amp;#8217;d read the abstract and look at the pictures.  We&amp;#8217;re after big-picture, so &lt;strong&gt;read&lt;/strong&gt; it only, don&amp;#8217;t &lt;strong&gt;trust&lt;/strong&gt; it. Documents are seldom accurate, and seldom for long.  It might be good preparation for your partner&amp;#8217;s visit.&lt;/p&gt;


&lt;h2&gt;Use The Tests, Luke&lt;/h2&gt;

	&lt;p&gt;Do you have tests?  If you are in a test-driven shop, looking at unit tests is a good idea. If they&amp;#8217;re written well, they are specifications (by example) of the system.  If they&amp;#8217;re written poorly, you know where to start your work at least. Your partner could do a great service by helping clean up the code instead of explaining it.&lt;/p&gt;


	&lt;p&gt;No tests? Uh, oh.  No tests &lt;strong&gt;and&lt;/strong&gt; no doc?  Now you&amp;#8217;re in trouble.&lt;/p&gt;


&lt;h2&gt;Scan the File Space&lt;/h2&gt;

	&lt;p&gt;Are the classes well-named? Do you know where to begin working? If you can find code by looking at file names then you&amp;#8217;ve got the handle you need.  Your partner can help improve file naming if you find the code you&amp;#8217;ve been handed is in ill-named files.&lt;/p&gt;


	&lt;p&gt;So you&amp;#8217;re in a file, you have a mission.  Either you have tests, or you&amp;#8217;re ready to write some.&lt;/p&gt;


&lt;h2&gt;Sense Of Smell&lt;/h2&gt;

	&lt;p&gt;What if the code is still not obvious?  You have one more resource before you have to print out the listing and break out the markers to reverse-engineer your way out of code hell.  You have your nose and your refactoring editor.  You can use refactorings such as &amp;#8216;rename&amp;#8217;, &amp;#8216;extract method&amp;#8217;, and &amp;#8216;introduce variable&amp;#8217; to clarify an existing method. You can spot duplication and eliminate it.  Maybe you can bring it to a point of clarity, and then you will know&lt;/p&gt;


&lt;h2&gt;Deep Code Spelunking&lt;/h2&gt;

	&lt;p&gt;It&amp;#8217;s time to pour a really big cup of tea, get some food, take a couple of preemptive aspirin, and make sure your printer has paper.&lt;/p&gt;


	&lt;p&gt;Sometimes, you will have to reverse-engineer some of the code you were handed. Your only hope may be to rebuild it from the inside-out.&lt;/p&gt;


	&lt;p&gt;You might want to either copy the code to a scratch space to do this.  Maybe you want to branch the project in version control.  You want to be free to dig in an learn this the hard way, and make it better as you emerge from the depths.&lt;/p&gt;


	&lt;p&gt;You still can/must use refactoring tricks to capture the knowledge you gain, but you may need to take the code off line. And look for new partners.&lt;/p&gt;</description>
      <pubDate>Wed, 05 Mar 2008 19:27:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:5a6bcbe7-686d-4cf3-8b45-6eb95e45c65e</guid>
      <author>tottinger</author>
      <link>http://blog.objectmentor.com/articles/2008/03/05/clues-for-reading-new-code</link>
      <category>Tim's Tepid Torrent</category>
    </item>
    <item>
      <title>"Clues For Reading New Code" by Belstaff Bags</title>
      <description>&lt;p&gt;Christmas Gift Idea &lt;a href="http://www.belstaff-bags.co.uk/" rel="nofollow"&gt;&lt;strong&gt;Belstaff  Jackets UK&lt;/strong&gt;&lt;/a&gt; are waiting for you! We are proud of offering  different &lt;strong&gt;&lt;a href="http://www.belstaff-bags.co.uk/" rel="nofollow"&gt;Belstaff Bags&lt;/a&gt;&lt;/strong&gt; for you, including &lt;a href="http://www.belstaff-bags.co.uk/" rel="nofollow"&gt;Mens Belstaff Jackets&lt;/a&gt; and &lt;a href="http://www.belstaff-bags.co.uk/" rel="nofollow"&gt;Womens Bestaff Jackets&lt;/a&gt;, so there are  many style jackets for you to choose in our online store. We also offer &lt;a href="http://www.belstaff-bags.co.uk/" rel="nofollow"&gt;Belstaff Bags UK&lt;/a&gt; for you.All of  these jackets are in top quality and very fashion, so you can not only keep  warm, but aslo stay fashion in the dull and cold weather. &lt;a href="http://www.belstaff-bags.co.uk/" rel="nofollow"&gt;Belstaff UK&lt;/a&gt; has enjoyed reputation  for such a long time. You have come to the right palce, so we sell them in low  price and all &lt;a href="http://www.belstaff-bags.co.uk/" rel="nofollow"&gt;http://www.belstaff-bags.co.uk/&lt;/a&gt; can ship freely to your door! What are you waiting for? Get one of them, the &lt;a href="http://www.belstaff-bags.co.uk/" rel="nofollow"&gt;&lt;strong&gt;Cheap  Belstaff Jackets&lt;/strong&gt;&lt;/a&gt; will give a surprise to you. Wish you have  a happy and wonder winter.&lt;br&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 13 Oct 2011 04:31:59 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:d970c090-dc83-4773-a037-12895054e30a</guid>
      <link>http://blog.objectmentor.com/articles/2008/03/05/clues-for-reading-new-code#comment-155960</link>
    </item>
    <item>
      <title>"Clues For Reading New Code" by okey oyunu oyna </title>
      <description>&lt;p&gt;good information&amp;#8230;&lt;/p&gt;


	&lt;p&gt;internette g&#246;r&#252;nt&#252;l&#252; olarak &lt;a href="http://www.okeyoyunu-oyna.com" rel="nofollow"&gt;okey oyunu oyna&lt;/a&gt;, ger&#231;ek kisilerle tanis,
 turnuva heyecanini yasa.&lt;/p&gt;</description>
      <pubDate>Wed, 27 Apr 2011 12:31:53 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:97da754f-e487-48ab-a6e0-6000464321fa</guid>
      <link>http://blog.objectmentor.com/articles/2008/03/05/clues-for-reading-new-code#comment-91834</link>
    </item>
    <item>
      <title>"Clues For Reading New Code" by Tenant Screening</title>
      <description>&lt;p&gt;If you can find code by looking at file names then you&#8217;ve got the handle you need. Your partner can help improve file naming if you find the code you&#8217;ve been handed is in ill-named files.&lt;/p&gt;</description>
      <pubDate>Mon, 21 Feb 2011 11:19:25 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:3cf85c07-852c-401c-8a64-69755ac78b62</guid>
      <link>http://blog.objectmentor.com/articles/2008/03/05/clues-for-reading-new-code#comment-65236</link>
    </item>
    <item>
      <title>"Clues For Reading New Code" by Criminal Records</title>
      <description>&lt;p&gt;Sometimes, you will have to reverse-engineer some of the code you were handed. Your only hope may be to rebuild it from the inside-out.&lt;/p&gt;</description>
      <pubDate>Thu, 17 Feb 2011 17:54:09 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:117261e4-a9e5-4b1c-9fb2-51beae0844e1</guid>
      <link>http://blog.objectmentor.com/articles/2008/03/05/clues-for-reading-new-code#comment-64021</link>
    </item>
    <item>
      <title>"Clues For Reading New Code" by Cheap Replica shoes </title>
      <description>&lt;p&gt;the Earth is superimposed onto the motion of the rest of the planets. In this simulation you are riding on the Sun, and large planets make the Sun wobble. &lt;a href="http://www.heyheytrade.com" rel="nofollow"&gt;www.heyheytrade.com&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 17 Dec 2010 01:42:19 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:f95911ff-6d43-4006-87b3-c520826d9345</guid>
      <link>http://blog.objectmentor.com/articles/2008/03/05/clues-for-reading-new-code#comment-49671</link>
    </item>
    <item>
      <title>"Clues For Reading New Code" by Pandora </title>
      <description>&lt;p&gt;This looks a lot like the way &#8220;good&#8221; inheritance should behave.&lt;/p&gt;</description>
      <pubDate>Thu, 02 Dec 2010 02:54:43 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:11561d5d-7ebc-493f-94a6-004b08c48c36</guid>
      <link>http://blog.objectmentor.com/articles/2008/03/05/clues-for-reading-new-code#comment-45339</link>
    </item>
    <item>
      <title>"Clues For Reading New Code" by iPhone to Mac Transfer</title>
      <description>&lt;p&gt;Backup all of your iPhone content to Mac without any hassle.&lt;/p&gt;</description>
      <pubDate>Mon, 22 Nov 2010 07:40:30 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:c2e8f9b3-ec16-4a53-9db4-cb72fce9ec86</guid>
      <link>http://blog.objectmentor.com/articles/2008/03/05/clues-for-reading-new-code#comment-42276</link>
    </item>
    <item>
      <title>"Clues For Reading New Code" by Patrick Smacchia</title>
      <description>&lt;p&gt;There are now some tools that can help a lot understanding a code base. Have a look at this features of the tool NDepend for example:
&lt;a href="http://www.ndepend.com/Features.aspx" rel="nofollow"&gt;http://www.ndepend.com/Features.aspx&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Sun, 30 Mar 2008 10:45:55 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:adc7cd4d-8033-476d-a561-2a5f3c5a9c12</guid>
      <link>http://blog.objectmentor.com/articles/2008/03/05/clues-for-reading-new-code#comment-1675</link>
    </item>
    <item>
      <title>"Clues For Reading New Code" by Rob Wehrli</title>
      <description>&lt;p&gt;I think that one of the most practical and immediately beneficial methods of &amp;#8220;interfacing&amp;#8221; with new code begins with doxygen -g and editing the Doxyfile.  Granted, it doesn&amp;#8217;t support every programming language ever invented, but it definitely covers the 80/20 rule.&lt;/p&gt;


	&lt;p&gt;Even uncommented code is traversable using Doxygen output.&lt;/p&gt;


	&lt;p&gt;Perhaps this is a hyper-extension to &amp;#8220;Scan the File Space,&amp;#8221; but it works well and the cash outlay is FREE + TIME.&lt;/p&gt;


	&lt;p&gt;Take Care.&lt;/p&gt;


	&lt;p&gt;Rob!&lt;/p&gt;</description>
      <pubDate>Thu, 13 Mar 2008 16:42:47 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:22a46e7f-2d4a-4058-83a8-76b9b1a4d76f</guid>
      <link>http://blog.objectmentor.com/articles/2008/03/05/clues-for-reading-new-code#comment-1660</link>
    </item>
    <item>
      <title>"Clues For Reading New Code" by Brian</title>
      <description>&lt;p&gt;&amp;#8220;Why not look at the documentation?  Just kidding. You know there&#226;&#8364;&#8482;s no documentation, and it&#226;&#8364;&#8482;s probably not useful.&amp;#8221;&lt;/p&gt;


	&lt;p&gt;LOL so true!!! :)&lt;/p&gt;


	&lt;p&gt;&amp;#8212;Brian
&lt;a href="http://www.BrianDiCroce.com" rel="nofollow"&gt;www.BrianDiCroce.com&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 13 Mar 2008 15:37:22 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:39305474-9ee0-436b-be18-d143ddec2fc3</guid>
      <link>http://blog.objectmentor.com/articles/2008/03/05/clues-for-reading-new-code#comment-1659</link>
    </item>
    <item>
      <title>"Clues For Reading New Code" by Prashant Rane</title>
      <description>&lt;p&gt;Code Analysis tools could help you here. Structure 101, Eclipse XRay plugin, Eclipse CAP plugin, MaintainJ, NetBeans UML support etc. can help you get the handle on the codebase.&lt;/p&gt;</description>
      <pubDate>Wed, 12 Mar 2008 16:13:04 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:bd4bfe19-705a-4e70-ac40-ec2bf36763e3</guid>
      <link>http://blog.objectmentor.com/articles/2008/03/05/clues-for-reading-new-code#comment-1656</link>
    </item>
    <item>
      <title>"Clues For Reading New Code" by Alex Miller</title>
      <description>&lt;p&gt;Nice ideas.  You might find my blog on &lt;a href="http://tech.puredanger.com/2007/09/18/spelunking/" rel="nofollow"&gt;code spelunking&lt;/a&gt;  to be a natural companion.&lt;/p&gt;</description>
      <pubDate>Wed, 12 Mar 2008 14:57:27 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:926f83cf-67f2-4c5b-a036-44055b0d2bb0</guid>
      <link>http://blog.objectmentor.com/articles/2008/03/05/clues-for-reading-new-code#comment-1655</link>
    </item>
    <item>
      <title>"Clues For Reading New Code" by ik_5</title>
      <description>&lt;p&gt;On open source projects, I usually do grep to look for something I do know, and try to go from there&amp;#8230; sometimes traveling with the code can gives you a lot of answers on the person who wrote it and how they think, and then it&amp;#8217;s easier.&lt;/p&gt;


	&lt;p&gt;I have learned not to use graphics tools because they usually omit few things, so the more basic your tools  are, the easier it is for you to find your hands and feet.&lt;/p&gt;


	&lt;p&gt;Having said that, it&amp;#8217;s always good to find someone that already know whats going on, that can direct you (like the author here wrote) ;)&lt;/p&gt;</description>
      <pubDate>Mon, 10 Mar 2008 06:24:01 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:3a1d9f41-6bfb-461c-ab0c-69ac695e11cf</guid>
      <link>http://blog.objectmentor.com/articles/2008/03/05/clues-for-reading-new-code#comment-1649</link>
    </item>
    <item>
      <title>"Clues For Reading New Code" by dmitry</title>
      <description>&lt;p&gt;At the last SoCal CodeCamp Woody Zuill gave an excellent talk on how to use mocks for exploratory programming of legacy code: &lt;a href="http://zuill.us/WoodyZuill/2008/01/14/nmock2-as-a-code-exploration-tool/" rel="nofollow"&gt;http://zuill.us/WoodyZuill/2008/01/14/nmock2-as-a-code-exploration-tool/&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 06 Mar 2008 12:15:59 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:f4bfc8c4-ee42-45d3-b7f1-0e98c5fc6207</guid>
      <link>http://blog.objectmentor.com/articles/2008/03/05/clues-for-reading-new-code#comment-1637</link>
    </item>
    <item>
      <title>"Clues For Reading New Code" by JJ</title>
      <description>&lt;p&gt;Haha very good introduction. This should teach all the newbies to know what they&amp;#8217;re getting into.&lt;/p&gt;</description>
      <pubDate>Thu, 06 Mar 2008 08:14:39 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:755e58e6-f4b1-4897-9e10-e0eb71f7a4b3</guid>
      <link>http://blog.objectmentor.com/articles/2008/03/05/clues-for-reading-new-code#comment-1635</link>
    </item>
  </channel>
</rss>

