Refactoring as Meta Programming?

Dave Thomas
<span title="">2005</span> <i title="AITO - Association Internationale pour les Technologies Objets"> <a target="_blank" rel="noopener" href="" style="color: black;">Journal of Object Technology</a> </i> &nbsp;
Refactoring [1] is widely acknowledged as one of the best practices of OO programming, and has been practiced in the functional and procedural community in one form or other for many years. Refactoring is a process that takes an existing program and improves it by transforming the program into a new program that is an improved version of the initial program. The improvements typically eliminate redundancy, improve maintainability and may improve performance and reduce space. In most cases, a
more &raquo; ... actored program has less code bulk than the initial program. Ideally, one would like to be able to take a working, but complex, application and refactor it to clearly show the various aspects that have been accidentally interwoven by the developers. I look forward with great anticipation to a true aspect refactoring browser. LANGUAGE AND TOOL IMPACT ON REFACTORING Refactoring has always been much more widely practiced in high-level languages such as Scheme and Smalltalk. These so called dynamic languages feature incremental programming support, minimal syntactic baggage, and simple compile time-type checking and access to the internal representation. Methods are also typically short and simple, relative to those written in a procedural style. Hence, they are much easier to refactor. Language technologies such as C++ or even Java or C#, which lack incremental support and refactoring browsers, present challenges for refactoring. They require much greater discipline and care when refactoring large application frameworks. Strong skills with tools such as Emacs are considered essential, as is pair programming and comprehensive test suites. Unfortunately, most IDEs/compilers do not like to see anything but well-formed programs. This often forces developers and/or tools to artificially introduce syntax and REFACTORING AS META PROGRAMMING? 8 J OURNAL OF OBJECT TECHNOLOGY V OL. 4, NO. 1
<span class="external-identifiers"> <a target="_blank" rel="external noopener noreferrer" href="">doi:10.5381/jot.2005.4.1.c1</a> <a target="_blank" rel="external noopener" href="">fatcat:z3brzq5fmrczxbgaxku35j7wee</a> </span>
<a target="_blank" rel="noopener" href="" title="fulltext PDF download" data-goatcounter-click="serp-fulltext" data-goatcounter-title="serp-fulltext"> <button class="ui simple right pointing dropdown compact black labeled icon button serp-button"> <i class="icon ia-icon"></i> Web Archive [PDF] <div class="menu fulltext-thumbnail"> <img src="" alt="fulltext thumbnail" loading="lazy"> </div> </button> </a> <a target="_blank" rel="external noopener noreferrer" href=""> <button class="ui left aligned compact blue labeled icon button serp-button"> <i class="unlock alternate icon" style="background-color: #fb971f;"></i> Publisher / </button> </a>