Hey,
This is something I've come across several times before when deprecating functions: people want different behaviour with regard to the warnings they get. Typically what people want can be split into two groups:
Weak deprecation: The function is documented as being deprecated but no wfDeprecated is put in
* Pro: People do not get flooded with deprecation warnings when the function is still in use at many places. * Con: It's impossible to actually get warnings for this usage of this function when desired for some purpose. When writing new code, it'd be good to be able to notice you're using deprecated functions. * Con: Many people won't notice they are using deprecated code at all, since not everyone is using an IDE highlighting deprecation and those that don't are definitely not looking at the definition of every function they use.
Strong deprecation: The function is documented as being deprecated and wfDeprecated is put in.
* Pros and Cons: opposite of the above
It's clear each that for different people the same approach might not be preferred. Discussion arises when some people do not want something to be strongly deprecated. What about introducing a soft deprecation function (ie wfSoftDeprecated) that calls wfDeprecated with an additional argument specifying it's a soft deprecation call, which by default does not result in any warnings or notices, but can by means of some setting be turned on by those that want to get them? Such a setting could either be a boolean, int (ie show warnings above this level) or some whitelist of softly deprecated functions one wants to get warnings for. Seems to be pretty trivial to accommodate both groups here, and get rid of the silly discussions.
Any thoughts?
Cheers
-- Jeroen De Dauw http://www.bn2vs.com Don't panic. Don't be evil. --