more useful options | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I'm posting this under SoPW because there isn't a category called "Pointless Debates". :-) What are people's preferences for how to name "getter" functions? One style guide I've read recommends naming functions after the thing that is returned -- e.g. "salary()". Another style guide recommends naming such a function "get_salary()". Is there any predominant style in the Perl community? Does the answer depend on whether the function is simply returning the salary or is actually computing it first? Does the answer depend on whether the function is part of a package or is actually a method in an object? On a related topic, do you prefer to see a separate "set_salary()" function, or do you prefer to see the same function performing both... uh... functions? Like I said, "Pointless Debates". :-) Still, I'm curious as to whether there is a clear preference. Wally Hartshorn In reply to Getter and Setter Function Names by Wally Hartshorn
|
|