Lecture
Deprecation (from English deprecation, literally «disapproval», a declaration that a feature is discouraged or obsolete) — in programming, an indication that the use of some part of a program, procedure, or programming language is undesirable. Most often, some means of indication that is standard for the given programming language or code documentation system is used, for example a service label (tag), a special language construct, and so on. Among developers of computer programs and documentation, the term deprecation may denote a particular stage in the software life cycle, the replacement of obsolete parts with new ones.
A part of a program or a method marked as deprecated is questionable, and its further use is unjustified. This part works in the current version of the software, but may trigger an error message as a warning. This serves to warn the user that the given part of the code may be removed in future releases of the program.
The main reason for declaring a part of the code (functions, methods, classes) as deprecated is the desire to improve the code and, at the same time, to gradually get rid of outdated approaches over time. Leaving old code alongside new code would lead to unjustified bloat of the software product, which would complicate its maintenance, study, and use. At the same time, simply removing obsolete parts of the code is undesirable, since it would break backward compatibility for users of the given software.
When code is marked as deprecated, a recommended replacement is usually indicated, for example a new component with a different programming interface, but essentially with the same functionality. Sometimes, however, a part of the code is declared deprecated without any replacement. This usually happens when bugs are discovered that are fundamentally unfixable while keeping the approach that was used.
When parts of a program depend on a part marked as deprecated, the programmer should rewrite the code to eliminate the use of the part scheduled for removal. It is also recommended to rewrite the code of existing programs, especially if they already depend on the version in which the functionality recommended as a replacement appeared.
In the Java language, two notations for this tag are used:
@Deprecated annotation — the compiler will mandatorily issue a warning about the use of an undesirable element.@deprecated — to note this in the documentation. Sun compilers also issue a warning (although the standard does not require doing so).In phpDocumentor, two descriptors are used, which are synonyms :
In Delphi, the keyword deprecated; is used
In C++14, the attribute [[deprecated]] is used
Although a deprecated software feature remains in the software, its use may trigger warning messages recommending alternative methods. A «Deprecated» status may also indicate that the feature will be removed in the future. Features are discouraged from use rather than removed immediately, in order to ensure backward compatibility and give programmers time to bring the affected code into conformance with the new standard.
Among the most common reasons for discontinuing support, the following can be highlighted:
smbfs and cifs. The latter provides better security, supports more protocol features, and integrates better with the rest of the kernel. Since the inclusion of cifs, smbfs is deprecated.gets() is an example, because using this function can cause a buffer overflow in the program that uses it. The Java API methods Thread.stop, .suspend, and .resume are additional examples. FONT element, allowing page designers to specify the font in which text should be displayed. With the release of Cascading Style Sheets and HTML 4.0, this FONT element became superfluous and lost the advantages associated with structural markup in HTML and graphical formatting in CSS. Thus, this FONT element was deprecated in the Transitional HTML 4.0 standard and excluded in the Strict variant.An example in hardware design is the absence of pull-up resistors on unused inputs of a logic element. This practice may have been acceptable in the past, but became obsolete, since higher clock frequencies can cause more transient noise on input lines, causing hardware faults or failures.
A building code example is the use of ungrounded («2-prong») electrical outlets. Over time, these old devices were abandoned in favor of safer grounded («3-prong») outlets. Older, ungrounded outlets were still permitted in many places by «grandfathering» them into existing wiring, but prohibiting them for new installations. Thus, although ungrounded outlets may still be available for legal purchase in a place where they are deprecated, they are generally intended only for repairing existing old electrical installations.
In writing and editing, the use of a word may be inadmissible because it is ambiguous, confusing, or offensive to some readers. For example, the words sanction and inflammable may be misinterpreted because they have auto-antonymic or contradictory meanings; writing style guides often recommend replacing them with other words that are clearly understood and unambiguous. Some uses of words that have acquired different connotations over time, such as «gay» or «colored», may be recognized as deprecated in formal writing.
In technical standards, the use of a particular clause may be disapproved or replaced by new clauses. For example, in the Ethernet standard IEEE 802.3-2012, clause 5 (Layer Management) is "deprecated" by clause 30 (Management), with the exception of clause 5.2.4.
The term obsolete may also be used when a technical term becomes obsolete as a result of change or replacement. An example from paleontology is the formerly obsolete term «brontosaurus»; before it was re-recognized as a unique genus, it was considered a popular but obsolete name for the genus Apatosaurus. Some examples of obsolete terms from medicine include consumption (tuberculosis), the grippe (influenza), and apoplexy (stroke). In the field of chemistry, the international standardization organization IUPAC (International Union of Pure and Applied Chemistry) abandoned the term «methyl ethyl ketone» and now recommends using the term «ethyl methyl ketone» instead.
Comments