Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: RFC: Test-Smart-0.01 (tye)

by Trizor (Pilgrim)
on Jul 25, 2007 at 13:08 UTC ( [id://628677]=note: print w/replies, xml ) Need Help??


in reply to Re: RFC: Test-Smart-0.01 (tye)
in thread RFC: Test-Smart-0.01

In response to your footnote, I am seriously considering changing the name to Test::AskAnExpert, its much more informative, and better than any of the crap I came up with before settling on Smart which still wasn't very good. However I already hit register namespace... do I just e-mail modules saying "Guys its been brought to my attention that the name sucks. I'll resubmit with a better one"? I really like Test::AskAnExpert better, and the change will be made if you point me in the right direction.

As for the "design smell" I'll see what I can do about it, I see your point and do see how it would be hard to point it out in any one line of code, but understand that its there.

Regarding the docs versus the exporting. Yikes that is a sore spot, should I export nothing by default?

Thank you for the response and the honesty, I'll work on attempting to re-work the worst of it and polish what can be saved.

Replies are listed 'Best First'.
Re^3: RFC: Test-Smart-0.01 (tye)
by mr_mischief (Monsignor) on Jul 26, 2007 at 18:27 UTC
    IMHO, Perl has enough syntax.

    Exporting functions adds to what looks like core syntax even though it's not. Forcing a user of your module to explicitly import something, to access it through the package namespace, or to create and object with which to interact all give a better clue as to where different variables and functions/modules come from.

    Exporting variables by default isn't any better. Your user is often writing the type of application for which you designed your module. There's often a lot of similar ideas for how to name variables when you and another person are working on the same problem. So please, don't give your user variables he's going to accidentally override.

    So I'd say that it is best to export nothing by default. Exporting upon request is okay. Object instantiation is okay. Exporting nothing and requiring the namespace to be specified is okay.

    Don't give me main::some_func() and especially not $main::some_var unless I ask for them. I don't want the potential conflicts, and I don't want to look back six months from now and have to search through my code and eight modules to figure out where $foo got set.

    The subroutines might not be so bad for an experienced Perl programmer because they've had time to assimilate what should be core syntax and what doesn't look familiar. A new Perl programmer, though, is likely already overwhelmed with all that's in perlfunc and will only get confused further by what's provided by CORE and what's provided by your module looking alike. Variables are always an issue, though, so that's even worse.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://628677]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2024-04-18 03:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found