JURASOURCE | WEBLOG | |
 

 

Like, uh, whatever, I guess

 

 
  Thursday, July 08, 2004
 
    [8:13:05 PM]

Tips for reading code


Now, I haven't actually read this yet, but as I'm going to be supporting an application I know nothing about in the near future, written in a language I hardly know (C++) I reckon it should come in handy. Of course we all have different techniques for getting up to speed with other peoples code, and I'm sure they all work well. This is what I tend to do (wonder how it'll compare with the article I'm posting...):


  1. Get the code into a place where you can mess with it without affecting anyone else (this might involve getting access to dev servers)

  2. Find out what the code does, at least what it's supposed to do (this is second on the list as the first one sometimes takes a while, it's good to set that process in motion)

  3. Get everything you need in order to build and run the code (this might involve third party components, or access to other dev servers and databases)

  4. Have a look at the code, see where the main areas are, and what they tend to do

  5. Run the code in debug mode, and if possible step through it whilst doing something typical (speak to the business if you don't know what a typical operation is)

  6. Concentrate on one area at a time, don't try and understand everything at once. Find the main areas of code that deal with that specific "thing", follow the trails to what that relies on. By doing this you'll start to get an understanding of the overall architecture

  7. Repeat the last step for each main area/"business function"



Oh, and if there is documentation available, read it !


Article: http://c2.com/cgi/wiki?TipsForReadingCode

    |
Comments: Post a Comment
 
 


ARCHIVES
 
November 2003
January 2004
February 2004
March 2004
April 2004
May 2004
June 2004
July 2004
 
     

This page is powered by Blogger. Isn't yours?  Weblog Commenting and Trackback by HaloScan.com