Are there best/recommended practices to follow when renaming functions in a new version of a package?

前端 未结 4 1119
执念已碎
执念已碎 2021-01-30 01:17

I\'m updating an old package and shortening a bunch of really long function names. How do I let a user know the the old function has been deprecated? I document everything with

4条回答
  •  误落风尘
    2021-01-30 01:32

    In the case of converting overly long function names to shorter versions, I'd recommend just exporting both names as the same function (see @Brandon's comment). This would allow old code to continue working while offering new users a more convenient alternative.

    In my mind, the only reason to tag something as .Deprecated (see @GSEE) would be if you plan to fundamentally change the functionality or stop supporting some feature in a future release. If this is the case, you can use the .Defunct or .Deprecated.

提交回复
热议问题