Skip Menu |

This queue is for tickets about the Moo CPAN distribution.

Report information
The Basics
Id: 93004
Status: resolved
Priority: 0/
Queue: Moo

People
Owner: Nobody in particular
Requestors: ribasushi [...] leporine.io
Cc: PLICEASE [...] cpan.org
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 2.000000



Subject: Default fatalization of warnings needs mst's clarification before new major strictures
Filing this as a ticket, with a blocker. There is oscillating chatter on IRC (mainly from Mithaldu and haarg) suggesting that "non-fatal uninitialized are not an option". In my very unhumble opinion (shared quite widely) this is not acceptable in production. In addition this is a needless distraction slowing down Moo supplanting Moose in places where it matters (i.e. on anything CPAN). Matt needs to join the discussion on this, before the rift reaches the point of no return (with mixes of Moo::Lax, patched up local Moo installs, forked Moo versions, and any combination thereof). The status quo is untenable.
I won't speak for haarg. I do however feel the need to correct you here, ribasushi. The reason why i talk about this matter is not that i think that "non-fatal uninitialized are not an option". The reason is that i do not understand why fatal undefs are not an option for some people. The reason i discuss is to get more information to understand their situation, so that i can empathize with them. Simply and bluntly put, any explanation given i have seen so far, boils down to a combination of these points: 1. they believe undefs cannot possibly do any harm 2. they do not wish to test their code 3. they do not wish to write code that expects actions to break and handles breakages I do not personally believe that the people who claim this actually have only these reasons, but i cannot think of further reasons, so i talk to try and understand them better. I'm not saying: You're wrong. I'm saying: Help me understand you.
+1; until a fix we will be locally patching Moo
+1 to this. I wrote Moo::Lax because imho it's wrong to impose fatal warnings to anyone using Moo. If Moo didn't force fatal warnings, or at least made it optional, then life would be better. Sometimes you need to add code to a codebase where warnings already happen. Moo::Lax allows me to add code using Moo without making existing code break.
+1 as well, although this is only one of many issues with Moo, things like the following are also an issue: - the VCS behaviors change in strictures (unacceptable assumption making) - the low quality error messages from type constraint failures (typically an "error at eval line ##" thing) - the inclusion of non-standard Moose features and behavior - the lax constructor (it seems to bless the hash it is given directly, haven't dug too much in this, but on the surface it seemed to be what was happening)
On Thu Feb 13 10:05:05 2014, STEVAN wrote: Show quoted text
> +1 as well, although this is only one of many issues with Moo, things > like the following are also an issue: > > - the VCS behaviors change in strictures (unacceptable assumption > making) > - the low quality error messages from type constraint failures > (typically an "error at eval line ##" thing) > - the inclusion of non-standard Moose features and behavior > - the lax constructor (it seems to bless the hash it is given > directly, haven't dug too much in this, but on the surface it seemed > to be what was happening)
Is this really the ticket for any of this? re: lax constructor, that happens for objects with no attributes.
Subject: Re: [rt.cpan.org #93004] Default fatalization of warnings needs mst's clarification before new major strictures
Date: Thu, 13 Feb 2014 15:08:02 +0000
To: Stevan Little via RT <bug-Moo [...] rt.cpan.org>
From: Peter Rabbitson <ribasushi [...] cpan.org>
On Thu, Feb 13, 2014 at 10:05:05AM -0500, Stevan Little via RT wrote: Show quoted text
> Queue: Moo > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=93004 > > > +1 as well, although this is only one of many issues with Moo, things like the following are also an issue: > > - the VCS behaviors change in strictures (unacceptable assumption making) > - the low quality error messages from type constraint failures (typically an "error at eval line ##" thing) > - the inclusion of non-standard Moose features and behavior > - the lax constructor (it seems to bless the hash it is given directly, haven't dug too much in this, but on the surface it seemed to be what was happening)
Stevan: So file separate issues for these? If they do not get fixed at least there will be linkable record (with discussion) of why Moo and Moose diverged. Also afaik the error messages were improved lately... a lot. If you don't like something - do your part in at least documenting it ;)
Subject: Re: [rt.cpan.org #93004] Default fatalization of warnings needs mst's clarification before new major strictures
Date: Thu, 13 Feb 2014 15:09:14 +0000
To: Christian Walde via RT <bug-Moo [...] rt.cpan.org>
From: Peter Rabbitson <ribasushi [...] cpan.org>
On Thu, Feb 13, 2014 at 09:52:28AM -0500, Christian Walde via RT wrote: Show quoted text
> > I'm saying: Help me understand you.
Christian: We had this argument time and time again. I explained you everything there is to explain, you kept saying "but where is your proof" and "but *I* lost money due to undef warnings, so could you!". So I will be blunt - at this point I am fine with you not understanding me. This is not about seeking a compromise, this is about undoing an experiment with a drastic change of defaults, which did not work out for many people (in contrast the strict+warnings by default worked out with relatively small amount of casualties). Forgive me for refusing to have a further argument with you on "BUT Y U NO WANT FATALZ?!" Cheers
On Thu Feb 13 09:52:27 2014, MITHALDU wrote: Show quoted text
> Simply and bluntly put, any explanation given i have seen so far, > boils down to a combination of these points: > 1. they believe undefs cannot possibly do any harm > 2. they do not wish to test their code > 3. they do not wish to write code that expects actions to break and > handles breakages
1) Not all undefs are harmful, this is a determination that should be made per-codebase and not enforced by a (well meaning) CPAN module. 2) Not all code can be tested with 100% coverage to ensure that no undef's will occur, especially if that code deals with any kind of input from the outside world. 3) See #2, not all breakage sites can easily be identified, captured and dealt with appropriately. See #1, not all breakages are really a "breakage" at that moment, and instead might be dealt with in another layer of the application. As I said in #1, this is a per-codebase determination and not something that should be decided by a CPAN module. The right thing to do is to decouple strictures from Moo, if Moo is truly to be the "Moose for CPAN", then it must shed its more controversial opinions, of which this is one.
Subject: Re: [rt.cpan.org #93004] Default fatalization of warnings needs mst's clarification before new major strictures
Date: Thu, 13 Feb 2014 15:23:12 +0000
To: Stevan Little via RT <bug-Moo [...] rt.cpan.org>
From: Peter Rabbitson <ribasushi [...] cpan.org>
On Thu, Feb 13, 2014 at 10:16:29AM -0500, Stevan Little via RT wrote: Show quoted text
> > ... > > The right thing to do is to decouple strictures from Moo, if Moo is truly to be the "Moose for CPAN"
Want to reiterate that the ticket is about ^^ this ^^. strictures.pm itself could very well continue injecting fatal warnings (though hopefully with a smaller scope). But the subject of this ticket as Stevan aptly put it is "Moo and Moo::Role (and by proxy Role::Tiny) should not inherit any of the controversial behaviors of strictures (which is sadly almost all of them)", and does not seek to affect the behavior of strictures in any way. Graham: (re IRC backlog) I didn't mean to single you out as "pushing for X". I simply have seen enough times how idle chatter leads to "just ship it". Hence the ticket and the instigated discussion. Cheers
On Thu Feb 13 16:09:22 2014, RIBASUSHI wrote: Show quoted text
> Cheers
Let me put things more simply: Please at least make some kind of attempt to not misrepresent me when talking about what i said. I'm fine if you don't want to have the discussion with me, but i get grumbly if you hyperbolize and misinterpret what i said and then use that to further your own points. ------ As for the discussion itself, personally i wouldn't mind at all if strictures was uncoupled from Moo. I find myself declaring my flavor of strictures manually as a matter of taste in all cases anyhow.
Since this discussion is getting split between IRC and RT, I'll quote myself here: <haarg> to clarify things re: strictures 2, as it is i'm just throwing in what ideas i have in case they end up being wanted/useful. i wasn't intending to ship anything until getting some clarification from mst and whoever else about what is wanted. <haarg> honestly i don't really care that much how things go re: uninitialized. i think it's perfectly reasonable to fatalize them, but others don't want to write code that way. <haarg> i don't intend to make any decision about what should or shouldn't be fatal in strictures, since it isn't my module.
Subject: Re: [rt.cpan.org #93004] Default fatalization of warninings
Date: Thu, 13 Feb 2014 18:03:46 +0100
To: bug-Moo [...] rt.cpan.org
From: demerphq <demerphq [...] gmail.com>
For me: Turning FATAL warnings on by default makes sense in a dev environment. It does not make sense in a production web environment. If FATAL warnings are enabled in a production environment then a minor error, like concatenating undef into a string or template, is something that *might* be visible to the user, but it also might not. It certainly wont impact much beyond making the page look less professional than it should. However when that undef causes the page to die, then the user is directly impacted. They either see a 500, or they get redirected to an error handler. One of the principal virtues of Perl is that it doesn't get its knickers in a knot over minor errors. It warns and moves on. Making Perl chuck all its toys out the pram because *maybe* that undef is Really Important, is a decision that should be left to the application designer, not a module author who has no idea of the relative trade offs where it is used. Yves -- perl -Mre=debug -e "/just|another|perl|hacker/"
On 2014-02-13 09:03:56, demerphq@gmail.com wrote: Show quoted text
> For me: > > Turning FATAL warnings on by default makes sense in a dev environment. > > It does not make sense in a production web environment.
I am largely in agreement with this, with the amendment "...for some environments". Whether to fatalize warnings should be left to the application developer, and not imposed from the outside by a library that is in use. Some applications will want to have fatal warnings in all cases, and some will not. That is their decision; we should not force one of our own. Any pragmas imposed on the calling environment by a used library should be restricted solely to things **necessary for that library to function** and no more. If the pragma was relatively harmless, we could overlook this, but it has been well-demonstrated that fatal warnings are not always harmless, e.g.: http://blogs.perl.org/users/peter_rabbitson/2014/01/fatal-warnings-are-a-ticking-time-bomb-via-chromatic.html I'm pro-choice about what I do with my application code. Are you?
FWIW, I concur that Moo should not impose the highly-opinionated strictures module by default and I would like to see that change now rather than wait for Moo version 2. I'm neutral about whether strictures should be enabled automatically in a detectable dev environment. Generally speaking, while I appreciate the valid case for globally fatal warnings, I think decisions about how many belts, suspenders, seatbelts, and airbags to use should be left up to developers who can write "use strictures" themselves if they so choose.
Thank you for being open to discussion about this issue. I agree in principle that warnings in my code need to be addressed and the underlying issues fixed, especially before going into production in most cases. I have to disagree with Moo imposing fatal warnings on my code. It is unnecessary and detrimental for both development and production environments. I want to see warnings during development and testing so I can fix them. I don't want my code to explode from a warning. Fatal warnings are not warnings anymore, they are errors. It's redefining a term that has a clear meaning in the context of software development. Production software is messy. As much as we would like all code we put into production to be clean, elegant, and well-behaved, this doesn't always happen. I might have to postpone cleaning up a warning to a later time. There might be a spurious warning caused by a rare edge case. These should not cause my production application to blow up. The consequences of not using fatal warnings in production is my responsibility. I think Moo is awesome and I'd like to keep using it. But until it stops imposing fatal warnings on my code I will have to use Moose for serious projects. Thanks for listening.
As someone who recently switched (most of) my Moo declarations to Moo::Lax, it would be grand to not fatalize warnings in a future release.
On Thu Feb 13 09:23:50 2014, RIBASUSHI wrote: Show quoted text
> Filing this as a ticket, with a blocker. There is oscillating chatter > on IRC (mainly from Mithaldu and haarg) suggesting that "non-fatal > uninitialized are not an option". In my very unhumble opinion (shared > quite widely) this is not acceptable in production. In addition this > is a needless distraction slowing down Moo supplanting Moose in places > where it matters (i.e. on anything CPAN). > > Matt needs to join the discussion on this, before the rift reaches the > point of no return (with mixes of Moo::Lax, patched up local Moo > installs, forked Moo versions, and any combination thereof). > > The status quo is untenable.
On consideration, it seems to me that the playing field has changed sufficiently that a chance is a good idea. The original motivation was for newbies coming afresh to M* style OO; more and more Moo is -also- being used as "Moose for CPAN" rather than just "Moose for constrained environments", so there are more people coming to it with assumptions based on long-standing usage of Moose. So, given the assumption that newbies always accept the defaults, I think we can probably achieve pretty much the same goal without annoying the crap out of everybody else by explicitly documenting use strictures; use Moo; in the SYNOPSIS, and changing Moo.pm itself to turn on only strict+warnings to bring it back in line with Moose. This *is* going to require a 2.0 label because code written under the assumption of fatal warnings may potentially do highly undesirable things in their absence, but that doesn't mean it necessarily requires that much waiting. I'll put out a blog post at some point soon trying to work out if there's anything else we'll want to change/break.
On Thu Mar 06 17:06:13 2014, neodon wrote: Show quoted text
> I have to disagree with Moo imposing fatal warnings on my code. It is > unnecessary and detrimental for both development and production > environments.
This is a question of coding style. Those of us who prefer to have them turned on find that we produce far more reliable code by doing so. I'd ask you to accept that it might be detrimental *to you* but it isn't to everybody, and that telling everybody else they're wrong when some of us have found demonstrable improvements in our defect rates as a result of this is just as silly as it would be for me to tell you that you're wrong for wanting things the other way. Show quoted text
> I think Moo is awesome and I'd like to keep using it. But until it > stops imposing fatal warnings on my code I will have to use Moose for > serious projects.
Or you could use Moo::Lax until we ship 2.0.
Small update on the matter, the code and doc update, done earlier by dams, is good to go: https://github.com/moose/Moo/pull/3/files This leaves mostly the meta tasks mentioned by mst.
Any news on this?
Subject: Re: [rt.cpan.org #93004] Default fatalization of warnings needs mst's clarification before new major strictures
Date: Thu, 29 Jan 2015 18:18:53 +0100
To: bug-Moo [...] rt.cpan.org
From: Peter Rabbitson <ribasushi [...] cpan.org>
Back to this thread. The current state of play is a lot better than almost a year ago. We now have this[1]. However in light of the list of *currently known* issues with warning fatalization[2] I posit that this is far from enough. On the code front the most troubling issue is the (still unfixed) FATAL-in-DESTROY crash, to which code in Method::Generate::DemolishAll is currently susceptible to. On the documentation front we have [3] which in light of [2] is nothing short of gravely misleading and irresponsible. I continue to maintain that given Moo's position and given *just the known* issues with FATAL warnings, strictures simply can not in any way be a part of the Moo load-chain. This would (as a bonus) sidestep the "vcs-like" heuristic to which fixes are still trickling in, as recently as this week [4]. At this point I believe I went above and beyond the reasonable level of argumentation that can be provided. I advise the maintainers to make their final decision based on the feedback on p5p. While I still hold faint hope that reason will prevail, I am "recusing" myself from further participation in this ticket. Cheers [1] https://github.com/moose/Moo/commit/3e6934f5#diff-05c05df49a171671ac3ccd3902fc0376L24 [2] http://thread.gmane.org/gmane.comp.lang.perl.perl5.porters/146265/focus=147472 [3] https://github.com/moose/Moo/commit/3e6934f5#diff-05c05df49a171671ac3ccd3902fc0376R892 [4] http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit/strictures.git;a=commitdiff;h=7bda951e
Subject: Re: [rt.cpan.org #93004] Default fatalization of warnings needs mst's clarification before new major strictures
Date: Thu, 29 Jan 2015 23:24:38 +0100
To: bug-Moo [...] rt.cpan.org
From: Peter Rabbitson <ribasushi [...] cpan.org>
On 01/29/2015 06:18 PM, Peter Rabbitson wrote: Show quoted text
> Back to this thread. The current state of play is a lot better than > almost a year ago. We now have this[1]. > > However in light of the list of *currently known* issues with warning > fatalization[2] I posit that this is far from enough. > > On the code front the most troubling issue is the (still unfixed) > FATAL-in-DESTROY crash, to which code in Method::Generate::DemolishAll > is currently susceptible to. > > On the documentation front we have [3] which in light of [2] is nothing > short of gravely misleading and irresponsible.
While agonizing over how to properly word the last update I *completely* missed commit 301f1e89db7 [1] that took place less than a day ago, and which addresses all the technical issues I raise above. At this point I do not see a blocker for Moo 2.0: as it stands under default conditions the code addresses both the undefined behavior in FATAL corner cases, and the optree mangling due to indirect/multidimensiona/bareword::filehandles. The opt-in mechanism is elegant and unobtrusive. The documentation still recommends use of FATALs, but this battle is in the hands of p5p at this point [2]. Apologies for the noise and the ill-timing of the previous email. Unless someone else has objections the ticket can be closed. Cheers [1] https://github.com/moose/Moo/commit/301f1e89db7 [2] http://thread.gmane.org/gmane.comp.lang.perl.perl5.porters/146265/focus=147472
I believe this has been adequately resolved by not applying fatal warnings to code using Moo, and only using strictures internally when testing out of the repo. Fixed in 1.999_001.
Resolved in Moo 2.