7.13 Use the Text Editor as a Browser
One of the best tools for
going through someone else's code is your text
editor. Suppose you want to find out what the variable
sc is used for. Use the search command to find the
first place sc is used. Search again and find the
second. Continue searching until you know what the variable does.
Suppose you find out that sc is used as a sequence
counter. Since you're already in the editor, you can
easily do a global search-and-replace to change the variable
sc to sequence_counter.
(Disaster warning: make sure sequence_counter is
not already defined as a variable before you
make the change. Also make sure you do a word
replacement or you'll find you replaced
sc in places you didn't intend.)
Comment the declaration, and you're on your way to
creating an understandable program.
|