Skip to Content.
Sympa Menu

devel - Re: [sympa-developpers] RFC: attribute management

Subject: Developers of Sympa

List archive

Chronological Thread  
  • From: IKEDA Soji <address@concealed>
  • To: address@concealed
  • Subject: Re: [sympa-developpers] RFC: attribute management
  • Date: Thu, 25 Jul 2013 17:17:01 +0900

FYI.

PerlMonks: Getter and Setter Function Names
http://www.perlmonks.org/?node_id=249433

On Wed, 24 Jul 2013 22:06:20 +0900
IKEDA Soji <address@concealed> wrote:

> > Fourth, it breaks another good practice, which considers than each
> > method name should be following an explicit naming rule, the more usual
> > being 'action_object' (for instance "send_message", "execute_query',
> > etc...). What does means $robot->main_menu_custom_button_3_target() ?
> >
> > Moreover, those accessors being read only, they'd better get named
> > 'get_something()' than 'something()'. You don't need to be a genious to
> > understand than there is something wrong in
> > '$robot->get_home("/var/lib")', whereas '$robot->home("/var/lib")' is
> > more ambiguous.
>
> This is rather a matter of preference, I suppose.
>
> Previous notation was:
> Sympa::Configuration::get_robot_conf("robot.name", "home")
> Someones prefer to:
> $robot->get_conf("home")
> or:
> $robot->get_home()
> Others do:
> $robot->home
>
> I love the last notation without redundancy: I feel "get_"
> is not required because it is obvious from the context.



--
株式会社 コンバージョン セキュリティ&OSSソリューション部 池田荘児
〒231-0004 神奈川県横浜市中区元浜町3-21-2 ヘリオス関内ビル7F
e-mail address@concealed TEL 045-640-3550
http://www.conversion.co.jp/



Archive powered by MHonArc 2.6.19+.

Top of Page