[Chicago-talk] Where'd I come from?

Jonathan Rockway jon at jrock.us
Fri Jan 26 10:21:31 PST 2007


Andy_Bach at wiwb.uscourts.gov wrote:
> Er, I'm not. Its 'legacy' production code which we can't really change 
> (and this'd be way down on the list of changes we'd like to make - its a 
> bit of a mess ;-).  The string evals are just something we shake our heads 
> at and live w/ ... and don't get me started on the 'package'-ing.  Worse 
> than not using it is a hit or miss mix of using it. 

This isn't directed at you personally, of course... but something to
keep in mind is that things don't get better until you fix them.

Maybe I'm imagining the worst... but it sounds like you are including so
many files via  'require foo.pl' that you've lost track of where things
are coming from.  If that's the case, I think you should step back and
start thinking about how to improve your codebase.  Write some tests,
then convert one file to a module.  See if the tests still pass.
Repeat.  Every individual iteration is small and manageable -- it won't
take long, and it will gradually improve the maintainability of your
code.  If you do this once a day (maybe spending 15 minutes on it),
before you know it you'll have a test suite and modular,
loosely-coupled, maintainable code.

Then you won't have to lose sleep worrying about whether that code you
pushed to production before you left is going to set off the pager at
1am. ;)

It isn't going to happen overnight, but it also isn't going to happen if
you don't do anything.

(Incidentally I've been doing this with one of our main applications.
What used to be 7000 lines of spaghetti is now *650* lines of
documented, tested code.  It's a really good feeling when you make that
much progress, and well worth the week or so it took.)

Regards,
Jonathan Rockway

-- 
package JAPH;use Catalyst qw/-Debug/;($;=JAPH)->config(name => do {
$,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //,
";$;"]->[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;->setup;


More information about the Chicago-talk mailing list