微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

C#:“过时”功能和“弃用”功能有什么区别?

参见英文答案 > The Difference Between Deprecated,Depreciated and Obsolete [closed]                                    8个
C#具有名为“Obsolete”的属性,表示不再使用该函数.在.net API规范中,当类/函数过时时,我们说这是“已弃用”.所以我想知道“过时”和“弃用”之间的区别.

>如果他们的意思相同,我们不需要2个字,对吗?
>如果他们的意思不同,为什么有时他们似乎在谈论同一个概念呢?

谢谢.

解决方法

按照 english.stackexchange.com

I don’t think that there is a strictly adhered-to distinction enforced
within the field of computer science. But in most contexts that I have
read,deprecated is more or less a “marker”,saying that it should not
be used,something else that has the same effect has been created
,and
it is soon to be deleted. It may still work as expected (read the last
paragraph on why I say may),but it will vanish soon. This is
intentionally done as part of the software development life cycle when
transitioning from one system to another–all of the functionality of
the old system is maintained in order to ensure that all past programs
still work,and it gives the developers time to transition their code
over to the new system.

Obsolete means that it no longer works as expected,or doesn’t do
anything at all
. This is different from non-functional,as it implies
that it was rendered so by a new functionality,or its function is
simply no longer relevant under the new parameters.

The line between these two terms gets blurred when a function is both deprecated and obsolete. Most of the time,an obsolete function gets deprecated,since it is preferable to deter developers from using it,and to delete it. Since it is generally advisable not to use a deprecated function,whether or not said function is also obsolete is irrelevant,and thus the conflation of the two terms.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐