|
|
|
|
|
by BrandonMTurner
5414 days ago
|
|
I think I am probably a little above average when it comes to reading, understanding, and fixing other people's code. Here are a few things that helped me train myself: 1) I read a lot of open source code, the more you read the more aspects you learn about the way other people code.
2) I fix a lot of bugs. At first I fixed bugs in an large open source project. Thats all I did in the project, just kept fixing bugs. Then when I got my first real job outside of school (MSFT) I fixed tons of bugs. I poached bugs off other people (this has a side bonus of your team quickly growing respect for you). Now, those are things that will help grow your skills but probably won't help you at this moment. Here are some tips for the way I approach the problem: 1) Use a debugger. Right from the start, use a debugger and look at the variables that are coming and going. Look at their values. Do this over and over again. 2) Rewrite the code. Even if you don't use the code and you end up reverting it all (which I do more often then using my re-written code). Start with the smallest methods and work your way up. You will begin to run into issues that the original author also probably ran into. Often times, these issues force the code into a certain form which would be non obvious just reading it. |
|