Refactoring Perl code

By Gabor Szabo (‎szabgab‎) from Israel.pm
Date: Monday, 20 August 2012 15:20
Duration: 20 minutes
Target audience: Beginner
Language: English
Tags: improvement legacy quality refactoring


Code refactoring is "disciplined technique for restructuring an existing body of code, altering its internal structure without changing its external behavior". It is needed to ensure your code remains readable while growing in size and scope.

It is needed if you have some old code base that needs improvement and after every period of intense development when you "did not have the time to properly design your code".

There are several patterns in refactoring, some of them you might already practice without knowing the name.

The most obvious is when you use a variable $x and suddenly you realize it could have a more descriptive name.
If you change all the occurances of $x to this better name, without changing anything else in the code, that's already refactoring.


Attended by: Martin Becker (‎martin‎), Julien Fiegehenn (‎simbabque‎), Gabriele Hack (‎gabimuc‎), Piotr Fusik (‎0xF‎), Benjamin Bosch, Tudor Constantin, Bert, Henrik Tougaard (‎htoug‎), Sebastian Willing (‎sewi‎), Jean Forget, Zbigniew Lukasiak (‎zby‎), Michael Jemmeson (‎michael‎), H.Merijn Brand (‎Tux‎), Alexander Hartmaier (‎abraxxa‎), Elena Bolshakova (‎helena‎), Barbie, Tobias Kremer (‎soulchild‎), Gabor Szabo (‎szabgab‎), Todd Rinaldo (‎toddr‎), Catalin Ciurea (‎catalin‎), Heinz Knutzen, Jess Robinson (‎castaway‎), Yanick Champoux (‎Yanick‎), Fabian Zimmermann (‎fobs‎), Michal Jurosz (‎mj41‎), Carlos Juan Diaz (‎cjuan‎), Ulrich Wisser (‎wisser‎), Jean-Baptiste Mazon, Patrick Mevzek, atoomic, Frank Lichtenheld (‎djpig‎), Dennis Stosberg, Richard Jelinek (‎TheWhip‎), Artur Spengler, Fredrik Thunberg (‎Thunis‎), Stefan Limbacher, Michele Beltrame (‎arthas‎), Henrik Hald Nørgaard, Kenneth Power, Jens Breitenbach, Andreas Altergott, Magnus Zeisig (‎magnuz‎), Mark Stringer (‎mullet‎), Minesh Patel, Manfred Stock (‎mstock‎), Lukáš Rampa, David Farrell (‎dnmfarrell‎), Alex Timoshenko, Roman Baumer (‎rba‎), Tudor Crisan, Bernd Ulmann (‎vaxman‎), Miguel Godinho, Sören Laird Sörries, david dunnington, Gerhard Raffius, Dave Sherohman (‎dsheroh‎), Patrick Michaud (‎Pm‎), Adina Iulia Dumitru, Christian Veigl (‎oftl‎), Markus Raulf, Mirela Iclodean, Istvan Gal, Darko Obradovic, Lars Thegler (‎tagg‎), Plesco Natalia (‎natasha‎), Hilko Bengen (‎hillu‎), Philippe Bruhat (‎BooK‎), Hans-Jürgen Schloz, John van Krieken (‎vladtz‎), Francoise Dehinbo (‎franky‎), Paolo Sinigaglia (‎psini‎), Felix Antonius Wilhelm Ostmann (‎Sadrak‎), Stepan Cenek, Jesper Dalberg, Tri Duong Tran,
Platin Sponsors Gold Sponsors Silver Sponsors Sponsors

Want to sponsor YAPC::EU? See the sponsor packages