What is a deprecated code?

Asked

Viewed 2,467 times

22

What is a deprecated code (code depreciation)? I heard about in a video lesson and I was in doubt.

  • 11

    Just to emphasize, «depreciated» is the wrong translation and this being misused and confused with the correct word, «depreciated» in English is «depreciated» and not «deprecated». The word «deprecated» that would be correct to refer to this would be translated as «obsolete», «disapproved», «censured». In the case of use here the best with certainty is «obsolete». Summarizing «depreciated» and «depreciated» has nothing to do with it.

  • 5

    appreciated code is one that people praise...and deprecated is one that people speak badly about...rsrsrsrsr or technically speaking is the code that is no longer recommended to use because there is another that does the same thing in a better or safer way(ie has more updated version of it)

  • @Sneepsninja you’re absolutely right.

5 answers

30


The real meaning for what the term is used in our area is obsolete, Although it is not the exact translation, it is what makes it clearer to us. At least it is considered obsolete by the original developer. You should do the same as much as possible. And it is always possible in new codes.

IS something that should no longer be used. It is a feature still existing, but which is considered outdated and has something better to use.

ob so le to |ê| (Latin obsoletus, -a, -um, worn, fallen into disuse) adjective

  1. Fallen into disuse; no longer used. = ARCHAIC

  2. That is out of fashion or does not correspond to the latest technical developments. = OLD-FASHIONED, OUTDATED . CURRENT, MODERN

  3. [Biology] Underdeveloped. = ATROPHIED, RUDIMENTARY, HYPERTROPHIED

"obsolete", in Dicionário Priberam da Língua Portuguesa [online], 2008-2013, https://www.priberam.pt/dlpo/obsoleto [consulted in 18-01-2017].

In English it is also used obsolete. Strictly would be the translation of obsolete, but it is more important to say something that people understand than to have a literal translation.

The term "depreciated" is a translation of depreciated which has another meaning, and therefore is a wrong translation for deprecated. Depreciated is something diminished, value reduced, which is not quite the case of our use, although it may be understandable.

Unless the video is bad-mouthing a code, there it is, but if it is, there’s nothing technical about it :)

de pre ci ar - Conjugate transitive verb

  1. Lower the value of. transitive and pronominal verb

  2. Not to give or not to give its fair value.

"depreciated", in Dicionário Priberam da Língua Portuguesa [online], 2008-2013, https://www.priberam.pt/dlpo/depreciado [consulted in 18-01-2017].

If you don’t like obsolete you can use "deprecated" which is a valid word in English and is strictly the most correct translation. But that doesn’t mean much to a Brazilian or Portuguese, according to Jorge B. in comment below (I don’t know in other countries).

de pre ca do (Latin deprecatus, -a, um, past participle of deprecate, -Ri, seek to ward off by means of supplications, ask, beg, beg, beg, beg, beg) adjective

  1. [Legal, Jurisprudence] It is said of the judge or court to which a judge or court ordered deprecated or request . act or due diligence.

  2. [Informatics] Whose use is no longer recommended (e.g.: this function is not obsolete, but is deprecated).

"deprecated", in Dicionário Priberam da Língua Portuguesa [online], 2008-2013, https://www.priberam.pt/dlpo/deprecado [consulted in 18-01-2017].

Use in languages

This is not something specific to PHP. Whenever you see this tag in some documentation, don’t use it, find out what you should use instead. There are pages of each version indicating what has been deprecated. Example in 5.5. When there is no substitute, it is because you should wear nothing, that is bad by itself.

It is common for them to generate a Warning. And warnings should be treated as errors, always. What is obsolete one day may cease to exist.

Some say deprecated is what will become obsolete, and obsolete is what has been withdrawn. This makes no sense, after all what has been removed is no longer obsolete, it is non-existent. What does not exist cannot be called deprecated or obsolete. In this case if you are going to quote what existed and no longer exists, the term should be "removed" or something that passes this idea.

  • 4

    In deprecated Portugal also does not mean anything, or we use «deprecated» or «obsolete».

  • 2

    «The term depreciated is translation of depreciated which has another meaning, and therefore is a wrong translation for deprecated.» The only correct answer in fact is your +1. Strangely the wrong answer gained more points http://answall.com/a/178139/3635, I think the people are giving upvotes without being sure/not confirming.

  • @Guilhermenascimento the question is perhaps more related to what it means in practical terms, and not the etymological origin of the term/best translation. The best response to the OP would have to be in this sense, I think, within the context of software development: what it means and what to do when faced with this term, which is what matters, after all.

  • @mrlew no, «depreciated» was translation error of the word «deprecated», by a clear mistake due to similarity, it is not a matter of practical or etymological terms, it is just confusion/error even. ;)

  • What the term refers to is in my answer and others. The question uses the wrong term, which must have been used wrong in the video class (ah go that PHP video class says wrong thing? : ) ). Hence my answer.

  • 2

    I will guess here that deprecated comes from demover to a precarious state. This may be subject to http://portuguese.stackexchange.com/

  • @bigown looks very likely, precarious state.

Show 2 more comments

9

The status deprecated (below I talk about the translation in Portuguese) is normally applied to a functionality (Feature), function, or any code encapsulation that is no longer being officially supported by its developer (here considering individual or company, responsible for editing the official versions of the software - usually the author).

This means, in other words, that the developer discourages the use of this code, despite it has not yet been removed from the source code.

It usually occurs when the developer has chosen not to further evolve that code (whatever the reason - security, performance, misspelled code), and usually presents a new alternative to solving the same problem that that function previously solved.

The message is from discouragement as to use, which does not mean that the use is prohibited. It’s a step for the code to be removed in the future and usually the message is something like: "this feature has been discouraged and will be removed in future versions".

This technique is widely used and mainly serves to maintain compatibility. Imagine if a developer, for example, discovers that a feature causes performance problems in a specific scenario and decides to simply remove the code, replacing it with another, incompatible with current versions. This would break several applications that use it. The recommended way is to discourage the use of the code, signal users that the code is no longer recommended (and will be removed in the next versions), and it is up to users, in this period, to arrange the updating of their applications.

In practice, then, it is best to always avoid code with this status, because they certainly had reasons for him being branded as deprecated. Always try to adapt to the alternative brought by the developer.


Example

A classic example in PHP (I mentioned in PHP why it was one of the tags in your question) was the function mysql_query, which had its use discouraged in version 5.5 and definitively removed in version 7, for security reasons mainly (motives).


About the term and the translation

Despite being used by the community of Brazilian developers, "depreciated" is not the English translation deprecated. Some maintain, on the other hand, that the best translation would be obsolete, or even deprecated.

Although it is only a simple matter of terminology, I leave here my humble considerations:

First of all, I believe obsolete would not be the best translation (despite being the literal translation to google), in my view, because a code marked as deprecated does not necessarily mean that it will become instantly obsolete. Fall into disuse would be when, voluntarily, the community ceases to use, that is, a code that is no longer useful over time. This is not always the case. In this sense too it would not be outmoded, archaic. A code that has been discouraged is not necessarily archaic or modern.

We may have a super popular code, but for security reasons, for example, the author has reported that it will be deprecated. Depreciating a code is sometimes a totally inverse process of forcing the code to stop being popular.

What I mean is that, by definition etymological, something cannot be made "obsolete" by someone, because fall into disuse is a natural process. Depreciation is something like "wanting it to be obsolete". To make the code deprecated is to hope that it falls into disuse. If it does not fall, and remains popular, many applications will break when it is removed. This is my point.

Going on. Searching for the original term, I realized that English-language dictionaries describe deprecate as "to not approve of Something" (Cambridge), "to express Earnest disapproval of" (Dictionary.com) meaning, it would be something like disapprove. You can see it has nothing to do with old-fashioned.

I think when the term deprecate for software development, what was meant was simply: "disapprove of use", in the teleological sense of "discourage".

Already the term belittle (which would be the translation of depreciate, something else) means, by Michaelis: reduce the value, devalue. If we are to consider applying a status of deprecated a code means to give a lower value to it, relative to others, can be a valid assertive. For example, if a function is maintained, tested, corrected, improved, refactored, it has an official, developmental, supported value. But that function that is not even on the test map, "marked to disappear", certainly has a lower value in the developer’s view.

But I agree it’s still not a translation for deprecate.

By way of conclusion, having made these considerations, my opinion is that there is no corresponding translation for this term as there seems to be no match in Portuguese (o termo foi de propósito rsrs).

And, going further, maybe this is one of the cases that the best is to speak in English in the middle of the sentence in Portuguese to make itself understood. Without a guilty conscience. Or use the deprecated, which seems to be the best alternative.

UPDATED

After writing the text above, I did some searching on Soen, and found some topics like this here, where some maintain that there is a difference between obsolete (is no longer used) and deprecated (is in use but will be removed), and someone even cited a relationship: "Something is depreciated until it is obsolete.". Just to illustrate.

  • 1

    No no, depreciated in English is Depreciated and nay Deprecated.

  • @Guilhermenascimento I did not state that deprecated meant depreciated. I made some considerations about the translation, I said it was not the ideal translation, and I concluded that there is no exact translation, since I understand that it is also not obsolete, for the reasons I explained (as out there too obsolete != deprecated).

  • It’s right at the start: The "deprecated" status (see about the term and translation below) is normally applied to a functionality (Feature), function, or portion of code that is no longer officially supported by its developer. The ideal translation has nothing to do is even translation error.

  • @Guilhermenascimento I edited to make it clearer. I used only as reference to the term used by the OP, but I didn’t make it clear, really.

  • I think you should focus on saying that the use of the word is wrong and remove all that is unnecessary to answer, giving more focus, but it is just an opinion for you to improve the answer. Light as a hint ;)

  • 1

    @Guilhermenascimento I edited to try to be clearer. Thank you. The main thing, in my opinion, is to respond to the OP which means a code deprecated, in the context of development (which means in practice and what to do when faced), which is what I understood he asked (although he did with the term translated wrong). I agree. Hugs

Show 1 more comment

7

Depreciated is a possible translation of Depreciated, that resembles Deprecated which means obsolete (which would be the most used in the programming area). As we use this word more in economic language, we are unaccustomed with this sense and sometimes, I agree, it gets weird.

Obsolete means everything that’s outdated, out of use, antiquated, archaic. Obsolete is also used in reference to things that as time passes they are being replaced, and this occurs with a very large frequency depending on the technology that is increasingly advanced.

When we use depreciated in Portuguese we pass the idea of something that lost value. Depreciated does not mean that the method has lost its value or suffered depreciation, but rather that it is no longer the approved way of doing something.

In particular, I prefer the term "disuse" (the method maeDaFoca() is in "disuse"), because disuse means "what is no longer in use", which is precisely the idea of deprecated: of, if possible, no longer use this method, as it will be removed or will no longer function.

An example of this type of method, is you check the class java.util.Date() version 1.6 of Java. .getDay(), for example.

References

  • 3

    No no, depreciated in English is Depreciated and nay Deprecated.

  • @Guilhermenascimento vlw for warning, you’re right... I made the correction;

  • This is correct now, but really I would rather stress to explain that both have nothing to do and the meaning of each ;)

1

Depreciation is usually when it has gone into disuse, where in new versions it has been or will be discontinued. Where something new appears to replace it. But what exactly did you hear about?

  • 8

    No no, depreciated in English is Depreciated and nay Deprecated.

1

It is some feature that is still present in a language/framework, but that will be removed in the next version.

So, in this case it is up to the programmer to use with caution, knowing that doing so will prevent the code from running in future versions.

Remembering that usually has something to replace. It is almost always a bad idea to choose to use something in these conditions.

  • 3

    No no, depreciated in English is Depreciated and nay Deprecated.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.