Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
In my defence, my guidelines were aimed at novice CGI programmers with many rules dictated by unofficial conventions that are used in our shop. This list is obviously more broadly aimed and as a style guide seems ok. Abigail pointed out my list omitted API/object interface guidelines and object initializators but so does this one:)

Abigail asked WHY? on two of my points so here are my justifications for them

'15. Always retrieve database rows into hash reference not arrays'

because if you have a table with fifty columns then you get an array with fifty elemnets and it can be hard to remember what field element 27 refers to after the array has been shunted about a bit. Also you have to manually map all the elements to the field names whereas with a hash you already have the data labelled with the field names.

'17. Assign CGI parameters to hashes'

So you can pass them around easily in one variable and you don't have loads of variables and $q->params flying about.

I also refute the fact I used any buzzwords. Anyway the more guidelines the better I say, as long as people don't treat them religiously.

In reply to Re: Re: Re: Re: My coding guidelines by hakkr
in thread My coding guidelines by Abigail-II

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: (5)
As of 2024-04-24 07:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found