• DocumentCode
    1405586
  • Title

    Refactoring on the Cheap

  • Author

    Spinellis, Diomidis

  • Author_Institution
    Athens Univ. of Econ., Athens, Greece
  • Volume
    29
  • Issue
    1
  • fYear
    2012
  • Firstpage
    96
  • Lastpage
    95
  • 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.
  • Keywords
    authoring languages; file organisation; program compilers; software maintenance; text editing; Perl and Ruby scripting languages; command-line invocation options; file names; in-place substitution functionality; refactoring possibility; sed; stream editor; substitution command; Computer languages; Encoding; Programming; Source coding; IDE; Unix; refactoring; regular expressions;
  • fLanguage
    English
  • Journal_Title
    Software, IEEE
  • Publisher
    ieee
  • ISSN
    0740-7459
  • Type

    jour

  • DOI
    10.1109/MS.2012.14
  • Filename
    6111371