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: Sat, 24 Feb 2018 15:57:28 +0100

On 02/24/2018 11:16 AM, IKEDA Soji wrote:
> On Thu, 22 Feb 2018 11:19:19 +0100
> Marc Chantreux <address@concealed> wrote:
>
>>> I think Marc/eiro summed it up with the sentence: "die early". It allows
>>> failures to be found early, even in places developers did not expect.
>>> As using it enforces usage of try/catch patterns at high level in the
>>> code,
>>> failures will always be caught.
>>
>> that is exactly the point.
>>
>> thanks for rephrazing it
>
> My opinion is ---
>
> Known by their names, Perl's builtin functions are low-level
> functions as thin wrapper of system calls. Their results are not
> straightly connected to result of each test unit. Programmers
> should write the code to decide what result is allowed and/or
> disallowed.
>
> In short, "early" check [1] of result is required to make test unit
> working expectedly.
>
> autodie warns this obvious fact, without giving any suggestions
> how we should do. I feel it is, at least for our project, not
> desired.
>
>
> [1] Note that "early check" includes ignoring results. For example,
> we usually need not checking result of close() (of course we may
> do, but gain little). However, in some cases we evidently should
> check, such as when we closed pipe. It is also we who decide
> whether result should be checked or not, not only it is expected or
> not.
>

I second this opinion.

Regards
Racke

>
> Regards,
>
> -- Soji
>
>> marc
>>
>
>


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