Refactoring Everything, Day 1

by chromatic

This 30-day project explores the refactoring of a legacy system. The Everything Engine is an aging software project that powers Perl Monks, Everything 2, and a few other websites. It suffers from poor design and maintainiability. Learn what it's like to look over the shoulder of an experienced developer as he refactors, redesigns, and updates the code.


2006-04-07 14:44:44
All that Subversion mime-type and eol-style property setting can be done automatically with auto-props in a Subversion configuration file. Here's one page with an example including both Windows and *nix instructions. It makes life with Subversion much easier.
2006-04-11 05:53:06
What a nice peek over your shoulder. Lots of leads to try out, here. Thanks, chromatic!
Aristotle Pagaltzis
2006-04-22 04:11:32

For the record, the one thing you should memorise is find -print0 | xargs -0.

Other relevant xargs switches: -t means “print each command line before executing” and -n $N means “only $N arguments per iteration.” So your for loop can be written like so:

find lib -name *.pm -print0 | xargs -0tn1 perltidy -b
Rob Biedenharn
2006-05-11 07:42:42
$ find lib -name *.bak | perl -nle unlink
only uses a single process for the unlinking rather than some number of 'rm' processes