Home United States USA — software Temporary Refactoring and Improving Your Code Reading Skills

Temporary Refactoring and Improving Your Code Reading Skills

168
0
SHARE

A developer discusses a method he recently discovered that has helped him and his colleagues better understand and read code written by other developers.
I was talking to a friend of mine, Scott, over Slack about reading code! Specifically, how to improve your code reading skills.
I asked him what he usually does when he reads source code. What he said is interesting:
He does a temporary refactoring. That’s it.
He usually takes a long method that can be separated out and then he turns it into a separate method.
For example- readEmployeeDataFromDatabase()
This method can be broken into multiple methods and he does that. He keeps doing that until he gets a sense for what the intent of the larger method is about. Then he takes a few notes on what the method does and rolls back the changes.
He also mentioned that he does not do any unit testing because this refactoring is only temporary, and used just to understand the code!

Continue reading...