Refactoring

Matts on 2001-10-02T09:25:23

I'm refactoring 10K lines of code this week. That's after I did some static analysis of the execution paths last week using some hairy regexps to detect what methods were called from what functions, and display the results in a tree (mail me if you want the code - I guarantee it won't work for anyone but me).

Refactoring this code is non-trivial at best. It's all one big script - all 10,000 lines of it. It contains a whole heap of global variables, so moving stuff into modules is proving difficult. I'm using the idea of a context object passed between each function, and then variables can get stored in that object. This makes it very easy to move functions around, but it requires the change to using $context everywhere first. Slow going.