The Community for Technology Leaders
RSS Icon
Subscribe
Issue No.01 - January/February (2012 vol.29)
pp: 96, 94-95
Diomidis Spinellis , Athens University of Economics
ABSTRACT
Refactoring with ad hoc methods increases the scope of possible refactorings, allows you to use the same approaches on various languages, and opens your mind to more refactoring possibilities. The basic tool for performing a refactoring within a file is the editor's substitution command used in conjunction with regular expressions. To apply substitution commands to all files in a directory or throughout your project use the stream editor sed. The Perl and Ruby scripting languages also offer in-place substitution functionality through command-line invocation options, and their expression evaluators allow you to perform more sophisticated processing. Finally, you can easily change file names or move files around by using find to locate the corresponding files and sed to craft the text of a command that will accomplish the action you want. You can increase your effectiveness in this approach by building expressions incrementally, by tolerating silence and noise, and by writing consistent code.
INDEX TERMS
refactoring, regular expressions, IDE, Unix
CITATION
Diomidis Spinellis, "Refactoring on the Cheap", IEEE Software, vol.29, no. 1, pp. 96, 94-95, January/February 2012, doi:10.1109/MS.2012.14
29 ms
(Ver 2.0)

Marketing Automation Platform Marketing Automation Tool