On Mon, Jan 30, 2012 at 01:02:16PM +0100, demerphq wrote: > On 30 January 2012 12:51, David Golden <xdaveg@gmail.com> wrote: > > On Mon, Jan 30, 2012 at 5:33 AM, demerphq <demerphq@gmail.com> wrote: > >> I personally think that deprecation warnings would be a lot easier to > >> add, and a lot less painful, if they were warn-first-use, instead of > >> the normal warn-every-use. > > > > use less 'warnings'; # :-) > > > > Serious note -- this seems like it should be a user option, not a > > default, if implemented. Are we out of command-line flags? (Would -X > > already suffice for this?) I note that "-q" (quiet) is available. > > I dont think it should be a user option. I think it should be the > default behavior for deprecation warnings. It does not add value to > repeatedly tell someone that the code is deprecated every time they > use a deprecated feature. After all the code is NOT misbehaving, it > simply will no longer work in a later release. This is quite different > from telling them that their code might be silently doing something > different than they think, which is why we normally warn every use. IMO, depraction warnings belong in linters. "use warnings" isn't a linter. I think that, for those that have warnings enabled, the emitting of warnings on each and every run of the program will be considered as bad as a breakage. What's the message we want to pass to the user? "Hey, your code is fine now, so you don't have to do anything now, but if in the future you're going to upgrade your perl, it may no longer work. However, although you don't have to fix this now, I'll keep bugging you until you do". To me, that's as useful and annoying as a car that starts beeping when the fuel tank drops below 99%, warning you that you don't have to refuel now, but eventually, you need to, and it will keep reminding you about it. > Also, your joke actually demonstrates why this should not be an > option: It wouldn't actually help as you would have to enable it in > every module which uses deprecated features. So it need to be a global > flag. Even then, there will be many users that cannot set it one way > or another. So IMO it should just be default behaviour. > > Lets not forget that we are piggy backing deprecation notifications > on top of a system that was designed for other purposes. As such I > think it is appropriate to change the behavior. +1 AbigailThread Previous | Thread Next