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...):
- Get the code into a place where you can mess with it without affecting anyone else (this might involve getting access to dev servers)
- 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)
- 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)
- Have a look at the code, see where the main areas are, and what they tend to do
- 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)
- 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
- Repeat the last step for each main area/"business function"
Oh, and if there is documentation available, read it !