From: Mike D. <md...@mi...> - 2000-08-14 11:22:28
|
>Ok, I got it added. All we have to do is decide what to call it. >changed_by sounds good, but looks funny in this usage: > > my $item_who_changed_it = changed_by $item_that_got_changed; > >So I used get_changed_by instead (I can easily change it if we vote >otherwise). While it took a little getting used to Java's "getters" and setters" (getCurrentUser, setSalary, etc.), I've come to appreciate that naming convention. OTHO, that convention is most readable when you use the dot-notation: float salary = boss.getSalary(); It makes less sense when used in Perl's object-last syntax: my $salary = getSalary $boss; # But I'd like to have my boss's salary <G> I vote to stick with MH's naming conventions; there are lots of other functions that return a value, but aren't prefixed with get_ . Mike ------ Mike Dodd - Montpelier, VA Modeling Virginian Railway, 1956 http://www.mindspring.com/~mdodd/vgn_main.htm |