Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Do you know where your variables are?
 
PerlMonks  

Re: Re: Re: Re: My coding guidelines

by hakkr (Chaplain)
on Nov 26, 2002 at 10:09 UTC ( #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.


Comment on Re: Re: Re: Re: My coding guidelines

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2014-04-17 05:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (439 votes), past polls