Sunday, March 15, 2009

Drowning In Code

Sometimes you have to work on old code.
(pause as the shock and cires of "Heretic!" die down)

Since not everyone gets to write only new code, you'll have to face this task many times in your career.
Here are two tips on how to approach it.

They both assume that you have limited documentation, obviously, since they promote looking at the code as opposed to looking at the documents; this is better anyway, since we all know that the docs are least likely to be accurate (followed closely by comments in the code)

Another good way to become familiar with the code is to look for something redundant that you can encapsulate into a method.  This can lead to significant code reduction, making it easier for you to understand the remaining code.




Technorati Tags --
, , ,
HTTP

No comments: