Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re^3: Good use for prototypes. On methods no less!

by thargas (Deacon)
on Jun 05, 2012 at 12:09 UTC ( #974439=note: print w/replies, xml ) Need Help??

in reply to Re^2: Good use for prototypes. On methods no less!
in thread Good use for prototypes. On methods no less!

OK. If you're considering this in the context of novice users, I would say, please don't do this. The error you get is going to be misleading:

Too many arguments for Thing::hack at ./proto-method line 16, near "1) +" Execution of ./proto-method aborted due to compilation errors.

If your goal is to help novice users, this seems to me not to be the a good idea, as the error says nothing about the actual problem. I don't think that this idea will help anyone, except in the sense that calling the method as a function will fail, unless they pass it no args.

Sorry. I've got no alternative suggestion, but I don't like this idea.

Replies are listed 'Best First'.
Re^4: Good use for prototypes. On methods no less!
by polymorpheus (Novice) on Jun 05, 2012 at 13:04 UTC

    Good point about novices. If the error message actually said "method called as a function" then it might be nice.

    I think I will give up on this one. Thanks for all the feedback!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://974439]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2018-02-20 12:37 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (271 votes). Check out past polls.