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

Re: Re: Object Oriented Programming in Perl.

by frankus (Priest)
on Aug 05, 2002 at 09:42 UTC ( #187612=note: print w/replies, xml ) Need Help??


in reply to Re: Object Oriented Programming in Perl.
in thread Object Oriented Programming in Perl.

I think it's conventional to put an underscore before your object variable names too, eg _beverage.

Erm, that's only for private properties, the rest are not prefixed with an underbar.
From perltoot:

Occasionally you'll see method names beginning or ending with an underscore or two. This marking is a convention indicating that the methods are private to that class alone and sometimes to its closest acquaintances, its immediate subclasses. But this distinction is not enforced by Perl itself. It's up to the programmer to behave.

I feel your statement is misleading. New developers could use underbar incorrectly in their own code, and using other folks modules.

--

Brother Frankus.

¤

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://187612]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2016-12-08 04:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (135 votes). Check out past polls.