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.

相关文章

目录简介使用JS互操作使用ClipLazor库创建项目使用方法简单测...
目录简介快速入门安装 NuGet 包实体类User数据库类DbFactory...
本文实现一个简单的配置类,原理比较简单,适用于一些小型项...
C#中Description特性主要用于枚举和属性,方法比较简单,记录...
[TOC] # 原理简介 本文参考[C#/WPF/WinForm/程序实现软件开机...
目录简介获取 HTML 文档解析 HTML 文档测试补充:使用 CSS 选...