Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Favorite Descriptive Variable Name

by jplindstrom (Monsignor)
on Dec 24, 2000 at 03:56 UTC ( [id://48183]=note: print w/replies, xml ) Need Help??


in reply to Re: Favorite Descriptive Variable Name
in thread Favorite Descriptive Variable Name

I use that all the time. Always.

My naming convention goes like this.

  • @aLine = array
  • $paName = pointer/reference to array
  • %hCountry = hash
  • $phLanguage = pointer/reference to hash
  • $objLog = reference to object

The only really bad thing about this is the pointer/reference mixup, since there really are no actual pointers in Perl. This is a Bad Thing, but I'm reluctant to change on account of too much legacy code. I really should take some time and fix that though.

Now, the good thing with using this naming convention everywhere is primarily that all parameters to subs are implicitly documented when it comes to type. I find that very useful.

/J

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-06-22 13:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.