Module talk:Deprecated

Deprecation
There is currently a sort of misrepresentation of the meaning of deprecation as used by this module. This is not deprecation, but simply removal. To deprecate is to discourage use of, while still retaining full unsupported functionality. There is no purpose to this Module:Deprecated if modules that use it have their entire functionality stripped, it is no different from a removal. There are several reasons why deprecation should be preferred:
 * Older revisions that may use deprecated modules will still function, or at least function to a better degree compared to removal.
 * Old code may be useful in different ways. Potentially harmful code may be avoided because it is understood by those visiting the module that it is deprecated, so it is also implicitly acknowledged that any code within may not be the the absolute best way to do something. Leaving things in the latest revision improves searchability for this purpose, both in the wiki and externally.
 * A module that is used in a user space may be deprecated. This would change or break the userpage. Editing the userpage could potentially be a fix but for the purist, it may not be advisable to edit such a userpage if it would change the meaning of the page. More importantly, it may not be possible in some cases to make a perfect transition to a non-deprecated counterpart by editing the userpage. A non-deprecated version with equivalent functionality may not exist on the wiki, either because the deprecated module itself has no replacements, or the replacement intended for the wiki is different from the original purpose or result of the original module.

That being said, this is a suggestion for how the deprecation module could be fixed. Instead of taking the module name and list of functions, it takes the module name and exported module table instead, and replaces each function with a proxy function that adds a warning both in mw.log and mw.addWarning, then executes the original function with the original arguments. However this way, a module cannot be deprecated per-function as it can now and the entire module must be deprecated. An optional list of functions parameter could be used to deprecate only select functions. Endilyn (talk) 03:23, 1 August 2020 (UTC)