Skip to Content.
Sympa Menu

devel - Re: [sympa-developpers] Why autodie?

Subject: Developers of Sympa

List archive

Chronological Thread  
  • From: David Verdin <address@concealed>
  • To: address@concealed
  • Subject: Re: [sympa-developpers] Why autodie?
  • Date: Tue, 20 Feb 2018 10:09:45 +0100

Hi, it's me again,


On 19/02/2018 18:25, Stefan Hornburg (Racke) wrote:
On 02/19/2018 09:41 AM, David Verdin wrote:
Dear all,

Soji just asked on the Sympa discussion channel why eiro wants to use autodie.

I'll try an answer here.

First: Sympatic: The idea of Sympatic is to give future developers a
boilerplate: include all modules that should be
used wherever in Sympa. So adding "use Sympatic;" includes a bunch of modules; adding
"use Sympatic -oo" includes the
same modules plus Moo.

In my opinion using Moo in a module would be the standard, so it should be
included by default.
Not necessarily. for example Sympa::Tools::* module don't really need the object paradigm. If we plan to make them available on CPAN, it would be rude to impose the usage of Moo ii it is not needed.
So I think the -oo option is quite welcome.

Second: autodie. it's included in Sympatic. Using this modules will raise a
die whenever the code can't succeed. eiro's
argument is to make sure an exception will be raised whenever the code does
not behave as intended.

The argument in favour of this module is the decreasing number of lines to
maintina to raise exceptions.
I'm not in favour of this - we should really take care about the error
handling by ourselves. Also some operations are
going to fail even if that is acceptable (open on custom files).
OK, that's a clear point of view. Let's read eiro's argument in favour of autodie now.

Thanks for your answer -and thanks to Soji's answer!

Regards,

David

Regards
Racke

The argument against it, in my opinion, is that, when reading a piece of
code, we won't know that an exception can be
raised in that exact place. I think we should maintain a minimum level of
hand-made exceptions with explicit exception
typing to be able to handle them correctly; the idea is that, in some cases,
exceptions should make Sympa die, and in
other cases it should not.

What is your opinion on this?

Regards,

David



--
"Mieux vaut viser la perfection et la rater que viser la médiocrité et
l'atteindre."
- Francis Blanche


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature




Archive powered by MHonArc 2.6.19+.

Top of Page