in reply to Net::Clacks Important data corruption bugfix released
Three suggestions:
- Write tests. You have no functional tests at all for anything, let alone regression tests for the issue you've fixed here
- Break up your subs. A subroutine should do one thing, and do it well. When it gets longer than a short scroll, it's time to think about breaking it up into smaller pieces of functionality. The run() method is almost 1,000 lines. That's almost 1,000 lines too many. IMHO, a run() method should be concise in what it does. Its flow should be easy to follow and troubleshoot. Organize all of the direct functionality it does into logical code units (subs) with descriptive names. Dispatch tables can help you seriously clean up the if/else stuff going on
- Write tests. Seriously. You've got a whole lot of conditional code in the module, and without tests, I can see a whole lot of problems arising out of even a simple change to the logic going on. Without tests, you might break 10 things without noticing before you even release the next version. Then to fix them without tests, you're bound to break another 10 unnoticed things
In Section
Perl News