Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C#: What's the difference between an "Obsolete" function and "Deprecated" function? [duplicate]

C# has attribute called "Obsolete" to indicate a function should no longer be used. While in .net API specifications, when a class/function is out-dated, we say this is "deprecated". So I wonder about the differences between "Obsolete" and "Deprecated".

  1. If they mean the same thing, we don't need 2 words, right?
  2. If they mean different thing, why sometimes it seems they're talking on the same concept?

Thanks.

like image 603
vik santata Avatar asked Oct 31 '22 19:10

vik santata


1 Answers

As per 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.

like image 111
Johan Avatar answered Nov 12 '22 23:11

Johan