Refactoring Pro-Tip: Making Local Variables Maximally Local

Refactoring Pro-Tip: When I tackle a long method, the first thing I do is make my local variables maximally local. Consider this psuedo-code. It’s basic stuff, I’m betting virtually any geek can read it, but if not, lemme know. longMethod( int y ) { int x; x = 0; // … // IRRELEVANCY #0: 87 lines that neither read nor write x // … if( y == 17 ) { x = 1; } // … // IRRELEVANCY #1: 87 […]

Refactoring Pro-Tip: Making Local Variables Maximally Local See Full Post