in reply to RFC: Another test module - Test::NoPlan

If it were my module, I would not export anything by default. Default exports are rather evil. When somebody comes along and reads the code:

all_plans_okay();

how do they find where this subroutine is defined? Well, that becomes obvious when the code above it is:

use Test::NoPlan qw( all_plans_okay );

I also find the module name implies nearly the opposite of what it does. I would rename it Test::AllPlans or similar.

I'd also never use the module since I have no problems just settings the 'plan' to some arbitrary number when I first start writing it and then fixing it as a final step. I never do a temporary "no plan". (It took me a while to realize what the motivation for the module was.)

But thanks for contributing this. I hope you find the feedback useful despite its shortcomings. :)

- tye        

Replies are listed 'Best First'.
Re^2: RFC: Another test module - Test::NoPlan (NoNoPlan)
by duncs (Beadle) on May 21, 2009 at 08:22 UTC
    If it were my module, I would not export anything by default.

    I have tried to write the module according to PBP (trying to improve my coding skills) and I just reread the section of it about exporting which suggests that since this one method will always be used by the programmer it should be exported by default. Also, since the test file it is in may only be a few lines long it seems reasonable for programmers to sumise where the method came from, so I think it may be better to export the one routine by default.

    I also find the module name implies nearly the opposite of what it does. I would rename it Test::AllPlans or similar.

    Until you pointed this out I didn't realise the name was a bit ambiguous - in my mind the name is 'Test-for-no-plan' which seemed to fit what it was about best - 'test-all-plans' implies to me that it does more than just checking to see if 'no_plan' has been used.

    Its one of those that I can see both sides of the argument, so in the long run I am not sure which might be best.

    I hope you find the feedback useful despite its shortcomings. :)

    This is the first module I have written from scratch for use on CPAN so if this is the 'worst' of the feedback I am actually quite happy about the points raised so far - after all, it is about improving my own coding skills rather than just throwing something on CPAN :)

    Duncs