Goke Pelemo

41%
Flag icon
One use of temporary variables is to capture the value of some code in order to refer to it later in a function. Using a temp allows me to refer to the value while explaining its meaning and avoiding repeating the code that calculates it. But while using a variable is handy, it can often be worthwhile to go a step further and use a function instead. If I’m working on breaking up a large function, turning variables into their own functions makes it easier to extract parts of the function, since I no longer need to pass in variables into the extracted functions. Putting this logic into functions ...more
Refactoring: Improving the Design of Existing Code (Addison-Wesley Signature Series (Fowler))
Rate this book
Clear rating
Open Preview