Skip to Content.
Sympa Menu

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

Subject: Developers of Sympa

List archive

Chronological Thread  
  • From: "Stefan Hornburg (Racke)" <address@concealed>
  • To: address@concealed
  • Subject: Re: [sympa-developpers] Why autodie?
  • Date: Mon, 19 Feb 2018 18:25:10 +0100

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.

> 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).

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
>


--
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.



Archive powered by MHonArc 2.6.19+.

Top of Page