in reply to Re(2): guidlines/rules (Don't use code templates!!!)
in thread Perl Programming guidelines/rules
Just to make it clear: ANYONE WHO USES IT AS IS STUPID BECAUSE ITS INCOMPLETE AND PROBABLY BROKEN
As you noticed it has some OO inconsitencies. This is because I don't use mod_perl, tend not to OO my CGI scripts, and I failed to completely convert to OO.
There may be acceptable code templates out there and I'm not opposed to them, per se, but they should be used with thought and caution.
100% agreement - see more comments below
This guy was using code templates and just blindly followed them. The templates provided a generic constructor and AUTOLOAD. Rather than thinking about what he was doing, he was just blindly following orders.(My emphasis)
Templates are there to get you started. Slavish devotion to a template, like slavish devotion to rules or anything else is always a problem. Neither templates nor rules will make a barely competant programmer into a genius, but a template can help the next guy figure out what dumb error Mr lowgrade bozo just committed.
A template like the one I suggested makes it relatively easy to generate test cases and to break down the action into separately testable chunks. As someone who has spent much time debugging other people's crud, this kind of inbuilt modularity and testability I wish to encourage, hence my template.
Dingus
|
|---|