Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Re: Re: Re: My coding guidelines

by hakkr (Chaplain)
on Nov 26, 2002 at 10:09 UTC ( [id://215812]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: My coding guidelines
in thread My coding guidelines

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://215812]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-04-19 22:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found