in reply to RE: RE: RE: new module idea
in thread new module idea

, there's no real need to keep use strict turned on

IMO, that isn't good practice, just leave it on. There are two camps on this but when you look at the majority of modules on the CPAN, strict is on and IMO should be left on. If I see a module with it commented out I wonder why.

So the end user can do it however they'd like

What happens when a user sets these things in the module itself then you update the module and someone reinstalls it? Poof, their setting are gone. You should not expect people to set anything like that in the module itself. If your module comes with an external config file, fine, but don't expect people to do it within the module.

I know that it's port 25 because I was lazy in it. *shrug* I s'pose I flip it back to be a user-configurable var in a future release.

What? And wipe out my default when I upgrade? No thanks ;)

I don't particularly like using POSIX (or any other module, if possible) in a CPAN distribution

Some people like it, some people don't. But POSIX comes with Perl, so people have it already. May be overkill for this module, but I like POSIX for various reasons.

I didn't finish error ...

I gave some suggestions. If the method is a noop, take it out until you do something with it.

I'm not convinced the end user will fully understand what they're used for

So? Then they find out. Your docs should have an example of how to use it (like every other module that uses this technique).

My biggest nit is that you tell people to set various defaults in the module (and set a few yourself). This has problems, and can lead to later problems (like reinstalling newer versions, and having to edit an installed module to set/change these).

Cheers,
KM

Replies are listed 'Best First'.
RE: RE: RE: RE: RE: new module idea
by turnstep (Parson) on Aug 14, 2000 at 22:51 UTC

    > >there's no real need to keep use strict turned on

    >IMO, that isn't good practice, just leave it on. There are two camps on this but when
    > you look at the majority of modules on the CPAN, strict is on and IMO should be left
    > on. If I see a module with it commented out I wonder why.

    I agree - short simple scripts don't need strict but when you have something large, and especially something like a module which may be used by others than yourselves, add the use strict. If it really bothers you, you can always turn it off with a no strict (this is sometimes even necessary) but it is better to make no strict the exception, rather than the rule.

      It's still simply a stylistic question.

      As I said, the module was developed with 'use strict' enabled. It's should behave perfectly fine with use strict turned on or not, I'm just leaving it up to the end user instead of forcing it on them.

      I will continue to view 'use strict' as a developer tool. It's something to aid in catching "bad" code and "bad" practices while developing, but after a piece of code is done, no development is going on and hence it's not really needed. It does add a slight performance hit (though it is almost negligible, I'll admit).

      Besides, there are far too many modules on CPAN that do not behave properly with 'use strict' to really argue over the merits of actually keeping it enabled or not in a submitted module. As long as it was written so that it behaves with use strict and/or $^W, I really don't care.