Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

At my company, we were on the verge of hiring a particular programmer. I wasn't too fond of the guy, but his code looked okay. My boss thought he was great and since I was willing to sign off on his code, he was probably going to get offered the job.

He was still bugging me, though. There were a few things about his code that just didn't belong there and I was struggling to figure out how someone who clearly knew Perl had such obvious pieces of cruft in his code. Some of it was a useless "ref $proto or $proto" line in a constructor. Some of it was an AUTOLOAD function that allowed the programmer to create accessors and mutators from object properties that didn't always exist. It was confusing.

Then we got lucky. Perhaps he was afraid he wouldn't get the job, but he followed up with another code sample. It was also good code, but it had the exact same problems as the first code sample he sent. That's when I realized what was going on. I knew some people at his previous company and made some calls. I was right. 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.

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).

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.

Cheers,
Ovid

New address of my CGI Course.
Silence is Evil (feel free to copy and distribute widely - note copyright text)


In reply to Re(2): guidlines/rules (Don't use code templates!!!) by Ovid
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 goofing around in the Monastery: (3)
As of 2024-04-20 14:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found