Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
No offense, but your code template would be horribly inadequate for a template for me. What about warnings? What about taint checking? What if I'm running under mod_perl and need to use the OO CGI interface (you mostly use that, but you have ":standard" in your import list). My template was meant as an example of what you could do - it was known to be incomplete and/or wrong. I hacked it in about 2 minutes from the one I do use to make it begin to correspond to the style that the original poster wanted.

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


Enter any 47-digit prime number to continue.

In reply to Re(3): guidlines/rules (Don't use code templates!!!) by dingus
in thread Perl Programming guidelines/rules by hakkr

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (1)
As of 2024-04-24 16:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found