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: Sat, 3 Aug 2013 10:00:42 +0900

Guillaume,

On Tue, 30 Jul 2013 16:09:43 +0200
Guillaume Rousse <address@concealed> wrote:

> Le 30/07/2013 14:45, IKEDA Soji a écrit :
> > Hi,
> >
> > Anyway, I had a chance to express my position. If someone thinks
> > "get_" prefix helps understanding by coders, I can not prevent it.
> That's rather an attempt to use a constant 'action_object' naming
> pattern over method names, all over the code. Especially when you have
> ambiguous words:
> - $robot->update_db_field_types
> - $robot->get_update_db_field_types
> The first one is ambigous, the second isn't.

It's a case the name of parameter would _also_ be changed, isn't
it? I already had pointed out existence of such paramenter names
(see POD of Site.pm): they don't look like "object".

"Anyway", I said, "... I can not prevent it". If you think "get_"
prefix is good practice, you would promote it. I'll never
obstable it. Moreover, I'll not be stingy about assistance
(of course assistance includes some criticism).


For example, you removed quotes of hash keys in listdef.pm etc.
Though that is allowed syntax, I'm not prefer to remove them
in some (partly unproved) reasons,

It is not true that either of you or me must always be wrong.

One known problem is that po/xgettext.pl won't work as excepted.
But it is insignificant problem. It is easy to fix xgettext.pl.

*

About a conversasion below:

I meant, "If the methods with same names as parameters are not used,
AUTOLOAD() will have no use". That's all.


Regards,

--- Soji

> > Use of AUTOLOAD is another issue: It is not a "magic". Dynamic
> > methods are ordinary things on some programming languages. I
> > simply used it to implement methods lookalike "attributes".
> Just because it exists does not means it is a good idea to use it. See
> for instance the 'grep test' discussion:
> http://jamie-wong.com/2013/07/12/grep-test/
>
> The article is interesting, because it's not just 'thou should never use
> dynamic code generation', but 'be careful when using it, it may hinder
> maintainance'.
>
> Another similar case is the usage of source filters, such as for
> instance the Switch module:
> https://metacpan.org/release/Switch
>
> Altough sometimes seen a convenient way to enhance code readability, it
> is also known to introduces subtle side-effects. I wonder for instance
> how does it interfer with perl debugger.
>
> In both case, this is a matter of balance between pros and cons.
>
> My point here is than I don't see any added values for:
> $robot->web_archive_spam_protection
> $robot->spam_protection
> $robot->color_5
> etc...
>
> Over:
> $robot->get_parameter('web_archive_spam_protection')
> $robot->get_parameter('spam_protection')
> $robot->get_parameter('color_5')
>
> I even think the first one is less self-explanatory, and reduces the
> visibility of the rest of Sympa::Robot API. Even if it was not
> implemented through AUTOLOAD...
>
> --
> Guillaume Rousse
> INRIA, Direction des systèmes d'information
> Domaine de Voluceau
> Rocquencourt - BP 105
> 78153 Le Chesnay
> Tel: 01 39 63 58 31
>


--
株式会社 コンバージョン セキュリティ&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