in reply to Re: Good use for prototypes. On methods no less!
in thread Good use for prototypes. On methods no less!
I don't necessarily want or need to do this, but yes, I was considering this in the context of best practices.
As you note, and Chromatic points out, the malicious user can easily get around this defense, but what about the novice user? it might help prevent a few bad cases from creeping into the code base. I have also been considering recommending an empty prototype on functions that do not take any args as this appears to be the one case where they are useful at pointing out usage errors early (compile time) to the user.
At a minimum, I am wondering about a perl critic exception to allow smart use of prototypes.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Good use for prototypes. On methods no less!
by thargas (Deacon) on Jun 05, 2012 at 12:09 UTC | |
by polymorpheus (Novice) on Jun 05, 2012 at 13:04 UTC |